lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Multiple location filters per search
Date Tue, 15 Jun 2010 00:43:12 GMT
: I am currently working with the following:
: 
: {code}
: {!frange l=0 u=1 unit=mi}dist(2,32.6126, -86.3950, latitude, longitude)
: {/code}
	...
: {code}
: {!frange l=0 u=1 unit=mi}dist(2,32.6126, -86.3950, latitude,
: longitude) OR {!frange l=0 u=1 unit=mi}dist(2,44.1457, -73.8152,
: latitude, longitude)
: {/code}
	...
: I get an error. Hoping someone has an idea of how to work with
: multiple locations in a single search.

I think yo uare confused about how that query is getting parsed ... when 
SOlr sees the "{!frange" at the begining of hte param, that tells it that 
the *entire* praam value should be parsed by the frange parser.  The 
frange parser doesn't know anything about keywords like "OR"

What you probably want is to utilize the "_query_" hack of the 
LuceneQParser so that you can parse some "Lucene" syntax (ie: A OR B) 
where the clauses are then generated by using another parser...

http://wiki.apache.org/solr/SolrQuerySyntax

fq=_query_="{!frange l=0 u=1 unit=mi}dist(2,32.6126, -86.3950, latitude, longitude)" OR _query_:"{!frange
l=0 u=1 unit=mi}dist(2,44.1457, -73.8152, latitude, longitude)"

   ...or a little more readable...

fq=_query_="{!frange l=0 u=1 unit=mi v=$qa}" OR _query_:"{!frange l=0 u=1 unit=mi v=$qb}"
qa=dist(2,32.6126, -86.3950, latitude, longitude)
qb=dist(2,44.1457, -73.8152, latitude, longitude)




-Hoss


Mime
View raw message