>From what I've seen so far, using separate fields for latitude and
longitude, especially with multiple values of each, does not work correctly
in all situations.

The hole in my understanding is how Solr knows how to pair a latitude and
longitude field _back_ into a POINT.

I can say that it doesn't work with multiple values and ranges, which is
an approach floated on the wiki and various blogs.

I can have qualifying longitude and latitude values that match a range
(not sure about distance function tho), but taken together should result in
a true negative, and not a false positive.

I'm hoping to learn how its done myself. But so far the wiki isn't clear
about it.


On Tue, 15 Jun 2010 09:35:15 -0500, Aaron Chmelik
<aaron.chme...@gmail.com>
wrote:
> Hoss,
> 
> Thanks for the response.
> 
> I was able to get multiple dist queries working, however, I've noticed
> another problem.
> 
> when using
> 
> fq=_query_:"{!frange l=0 u=25 v=$qa}"
> qa=dist(2,44.844833,-93.03528,latitude,longitude)
> 
> it returns 9,975 documents. When I change the upper limit to 250 it
> returns 33,241 documents. So, the filter is doing something.
> 
> But, the lat/long on the documents returned puts them well beyond the
> limit - for example, the first document returned with an upper limit
> of 25 has the following values:
> 
> [latitude] => 36.0275
> [longitude] => -80.2073
> 
> which is 907 miles away from the originating point.
> 
> Currently, my lat/lon fields are indexed using
> 
> <field name="latitude" type="tdouble" indexed="true" />
> <field name="longitude" type="tdouble" indexed="true" />
> 
> I have no doubt there is something I am missing, and any help would be
> greatly appreciated.
> 
> Aaron
> 
> On Mon, Jun 14, 2010 at 7:43 PM, Chris Hostetter
> <hossman_luc...@fucit.org> wrote:
>> : 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
>>
>>

Reply via email to