Hi,

I currently have a query as below. I am using the fq only if latlong value
(using switch plugin) is not empty else I am not using fq at all.

Whenever latlong value is empty, I just use value of $where (in "q")
parameter to return the results based on location.

Now whenever latlong value is available I need to use both $where as well as
the values returned by $lallong (geo spatial search). Currently the values
first get filtered based on 'q' first and then the values are passed to fq
hence the values returned are always subset of the values returned by 'q'. 
I need 'q' to boost the score of the documents.

Can someone let me know how to return the values corresponding to fq
(without getting filtered by 'q')?

Example:

If I search for a place like Charlotte, NC (by passing the latitude and
longitude with distance of 20 miles), I get only the results belonging to
Charlotte, NC when I use the below query. I need to return all the results
based on distance. If I dont pass the latitude and longitude but rather if I
just pass Charlotte, geo spatial function won't kick in hence the results
will be just based on $where value in 'q'.

<lst name="defaults">
<str name="q">
(
          _query_:"{!cust1 qf=person_name_lname_i v=$lname}"^8.3 OR
          _query_:"{!cust1 qf=person_name_lname_phonetic_i v=$lname}"^8.6
        )
        (
          _query_:"{!cust df='addr_location_clean_i' qs=1 v=$where}"^6.2 OR
          _query_:"{!cust df='addr_location_i' qs=1 v=$where}"^6.2
        )
</str></lst>

 <lst name="appends">
          <str name="fq">{!switch case='*:*' default=$fq_bbox
v=$latlong}</str>
      </lst>
      <lst name="invariants">
          <str name="fq_bbox">_query_:"{!bbox pt=$latlong sfield=geo
d=$dist}"^0.2</str>
</lst>




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Question-on-forming-query-when-using-switch-parser-plugin-tp4073847.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to