Wednesday, 8 March 2017

Specification of Solr Operator.

 Solr Operator

1, commonly used-
Q - query string, this is a must. If the query all *: *, according to the specified field query (Name: Drake and AND Address: Delhi)

Fq = CreateDate: [20170101 TO 20170131], find the keyword mm, and Create Date is the query, in the q query query results are fq query at the same time, for example: q = Name: 20170101

Fl - Specifies to return those field contents, separated by commas or spaces.

Start-return the first record in the complete search results in the offset position, 0 start, the general use of paging.

Rows - Specifies how many records to return to the results, with start to achieve paging.

Sort - sort, format: sort = + [, +] .... Example: (score desc, price asc) that the first "score" descending order, and then "price" ascending order, the default is the descending order of relevance.

Wt - (writer type) Specifies the output format, which can have xml, json, php, phps.

(Such as: Name, SKU, ShortDescription, or Name SKU ShortDescription [Note: the field is strictly case-sensitive]) if the query field is separated by a comma or a space Q.
op represents the logical operation of the condition of the query in q and AND (OR)

Hl is highlighted, such as hl = true
Hl.fl highlight field, hl.fl = Name, SKU
Hl.snippets: default is 1, here set to 3 fragments
Hl.simple.pre Highlight the previous format
Hl.simple.post highlights the format behind

Whether to start statistics
Facet.field statistics
[Note: The above is a more commonly used parameters, of course, the use of specific parameters or see Solr official technical documents]

Second, Solr operator
1. ":" specify the field to check the specified value, such as return all values ??*: *
2. "?" Indicates a wildcard for a single arbitrary character.
3. "*" indicates the wildcard of any number of characters (can not start using * or? Symbols in the retrieved item).
4. "~" that fuzzy search, such as the search spelling similar to the "roam" item to write: roam ~ will find the shape of the words such as foam and roams; roam ~ 0.8, retrieve return similarity in the record of 0.8 or more.
5. Neighborhood search, such as the search for 10 words separated by "apache" and "jakarta", "jakarta apache" ~ 10.
6. "^" control relevance search, such as the search jakarta apache, and want to let "jakarta" relevance is better, then add "^" symbol and incremental value, that is, jakarta ^ 4 apache.
7. Boolean operators AND, ||.
8. Boolean operators OR, &&.
9. Boolean operators NOT,!, - (exclude operators can not be used separately with the use of the query)
10. "+" exists operator, the required symbol "+" after the entry must be in the corresponding domain of the document.
11. () is used to construct sub queries.
12. [] contains a range of searches, such as retrieving a period of time records, including head and tail, date: [201609 TO 201612].
13. {} does not contain scope searches, such as retrieving a time period record, excluding head and tail
Date: {201609 TO 201612}.
14. / escape operator, special characters include + - && ||! () {} [] ^ "~ *:

Note: ? "+" and "-" that the modification of a single query unit, and, or, not is the intersection of two query units or do the difference or reverse the operation of the symbol
For example: AB: india + AB: america, that is AB: india ignore the dispensable, must meet the second condition is right, rather than what you think must meet the two search conditions
If the input: AB: india AND AB: america, the analytical results are two conditions at the same time to meet, that is, + AB: india AND + AB: america or + AB: india + AB: america
In short, the query syntax: modifier field name: query keyword AND / OR / NOT modifier field name: query keywords

Third, Solr query syntax
1. The most common query, such as query surnamed Drake (Name: Drake), if it is accurate search is equivalent to SQL SERVER in the LIKE search This requires quotation marks (""), such as inquiries containing Delhi(Address: Delhi").
2. Multi-conditional query, Note: If you can search for a single field can be used (Name: search conditions plus operator (OR, AND, NOT) Name: search conditions), such as fuzzy query (Name: ) Single field multi-condition search is not recommended to write, the general recommendation is in a single field for conditional screening, such as (Name: Drake OR), multiple field query (Name: Drake + Address: Delhi).

3. Sort, such as name asc (Name asc), descending (Name desc).

Tuesday, 7 March 2017

How to Disable Right Click on your Website.


Today I am Going to tell you how to disable Right Click on your Web Page. Its a Javascript code by
using this you can easily disable right click on your web page.


<script language="JavaScript">

var message="Right Click Disabled";

function clickIE7(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS6(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==3||e.which==4){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS6;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE7;
}

document.oncontextmenu=new Function("alert(message);return false")

</script>

Wednesday, 1 March 2017

How to Fetch Data from Current address to Permanent address.


Fetch data from Current address to Permanent address. First of all you have to make a HTML form for Current address and Permanent address according to your field and call their id according to the javascript.  



<form action="" method="post">
                  <div class="row">
                            <div class="">
                              <div class="">
                              <div class=" form-group">
                                 <label class="">Current Address<span class="red">* </span></label>
                                 <textarea class="form-control" id="addr" name="Address" ></textarea>
                              </div>                                
                                <div class="">
                                   <label class="">State<span class="red">* </span></label>
                                  <select name="State" id="state" class="state form-control"  >
                                    <option selected="selected" value="">--- Select State ---</option>
                                    <option value='DELHI'>DELHI</option><option value='Karnataka'>Karnataka</option>
                                  </select>
                                </div>                                  
                                    <div class="">    
                                         <label class="">City<span class="red">* </span></label>
                                        <select name="city" id="city"  class="city form-control">
                                            <option selected="selected" value="">--- Select City ---</option>
                                            <option value='DELHI'>DELHI</option><option value='Bangalore'>Bangalore</option>
                                        </select>
                                    </div>
                                    <div class=""  id="othercity"  style="display:none;"> </div>                              
                                    <div class=" form-group">
                                         <label class="">Pin code<span class="red">* </span></label>
                                         <input type="number" name="Pincode" id="zipcode"   value="" class="form-control" />
                                    </div>
                                        <div class="">
                                            <input id="city" type="checkbox" name="city" value="" onclick="Functioncopy(this);"><label for="city"><strong class="s3">Is Your Permanent Address is same as Current Address</strong></label>
                                        </div>
                              </div>
                                <div class="">
                                    <div class="">
                                     
                                        <div class="">
                                             <label class="">Permanent Address<span class="red">* </span></label>
                                             <textarea class="form-control" id="addr1"  name="addr1" ></textarea>
                                        </div>
                                       
                                    </div>
                                   
                                        <div class="">  
                                            <label class="">State<span class="red">* </span></label>
                                            <select name="State1" id="state1" class="state1 form-control"  >
                                                <option selected="selected" value="">--- Select State ---</option>
                                                <option value='DELHI'>DELHI</option><option value='Karnataka'>Karnataka</option>
                                            </select>
                                        </div>

                                        <div class=" form-control">      
                                            <label class="">City<span class="red">* </span></label>
                                            <select name="same_city" id="same_city"  class="city1 form-control">
                                               <option selected="selected" value="">--- Select City ---</option>
                                               <option value='DELHI'>DELHI</option><option value='Bangalore'>Bangalore</option>
                                            </select>
                                        </div>
                                   
                              <div class=""  id="othercity1"  style="display:none;">       </div>

                            <div class="">    
                               <label class="">Pincode<span class="red">* </span></label>
                              <input type="number" name="pin1" id="pin1"  value="" class="form-control" />
                              </div>
                           </div>
                        </div>
                     </div>
                 
                <div class="col-md-12">
                      <div class="col-md-6">
                          <input type="submit"  class="btn btn-info "  name="submit" value="Submit" />
                      </div>
                 </div>

            </form>

<script type="text/javascript">
      function Functioncopy(checkbox) {
        if (checkbox.checked) {
            document.getElementById("addr1").value = document.getElementById("addr").value;
            document.getElementById("state1").value = document.getElementById("state").value;
             var c = document.getElementById("city").value;  
            document.getElementById("pin1").value = document.getElementById("zipcode").value;
            //alert(''+c);
            if(c == 'other')
            {    
                document.getElementById("same_city").style.display = "block";
                document.getElementById("same_city").value = c;
                document.getElementById("othercity1").style.display = "block";
                var html = othercity1();
                $("#othercity1").html(html);              
                document.getElementById("othercity4").value = document.getElementById("othercity3").value;
            }
            else{
                document.getElementById("same_city").style.display = "block";  
                document.getElementById("same_city").value = c;                
                var html = '';
                $("#othercity1").html(html);  
                document.getElementById("othercity1").style.display = "none";
            }

            document.getElementById("city1").style.display = "none" ;
        }
        else {
            document.getElementById("addr1").value = "";
            document.getElementById("state1").value = "";
            document.getElementById("city1").value = "";
            document.getElementById("pin1").value = "";
             document.getElementById("same_city").style.display = "none";
            document.getElementById("city1").style.display = "block" ;
        }
    }
 
</script>