Query on multiple points of latitude and longitude

Submitted by ramkrs80 on Thu, 2011-05-05 20:19.Troubleshooting

I want to form a query that takes multiple latitude and multiple longitude for ex (latitude:38.7936111111111 latitude:38.2161111111111 latitude:38.6863333333333 latitude:38.2086111111111 latitude:38.7 latitude:37.9936111111111 latitude:38.0127777777778 latitude:38.5267 latitude:38.0769444444445 latitude:38.8038888888889 latitude:38.8033333333333 latitude:38.7905555555556 latitude:38.7905555555556 latitude:38.8102777777778 latitude:38.6825 latitude:38.5638 latitude:38.0761111111111 latitude:38.6653 latitude:38.7522222222222 latitude:38.1249 latitude:39.1701 longitude:-109.542777777778 longitude:-110.739722222222 longitude:-109.5335 longitude:-109.371111111111 longitude:-109.564333333333 longitude:-110.497777777778 longitude:-111.010277777778 longitude:-110.9015 longitude:-110.7375 longitude:-109.613055555556 longitude:-109.613333333333 longitude:-109.606111111111 longitude:-109.606111111111 longitude:-109.301111111111 longitude:-108.974444444444 longitude:-110.704 longitude:-110.7825 longitude:-110.7254 longitude:-110.799166666667 longitude:-110.7574 longitude:-110.4477 ) and then performs the search on these points.

At present it does not work as it is . What would be the correct syntax for this one.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by will on Fri, 2011-05-06 08:04.

I suppose you want to have OR as the boolean operator?

For q and lq, you can use this respectively:

Submitted by ramkrs80 on Fri, 2011-05-06 08:55.

I tried using the following query

"http://localhost:8080/dbsight/search.do?indexName=ik_index&lucene=y&templateName=&lq=latitude:( 41.8927777777778 &lqbooleanOperator=AND 41.9705555555556 &lqbooleanOperator=AND 41.9208333333333 &lqbooleanOperator=AND 42.9558333333333 &lqbooleanOperator=AND 42.1208333333333 &lqbooleanOperator=AND 41.7780555555556 &lqbooleanOperator=AND 41.9738888888889 &lqbooleanOperator=AND 41.9527777777778 &lqbooleanOperator=AND 41.9527777777778 &lqbooleanOperator=AND 42.0916666666667 &lqbooleanOperator=AND 42.0922222222222 &lqbooleanOperator=AND 43.625 &lqbooleanOperator=AND 43.625 &lqbooleanOperator=AND 42.0875 &lqbooleanOperator=AND 43.5008333333333 &lqbooleanOperator=AND 42.8277777777778 &lqbooleanOperator=AND 42.0861111111111 &lqbooleanOperator=AND 43.3961111111111 &lqbooleanOperator=AND 41.9233333333333) longitude:( -113.400277777778 &lqbooleanOperator=AND -113.435277777778 &lqbooleanOperator=AND -113.408611111111 &lqbooleanOperator=AND -113.213611111111 &lqbooleanOperator=AND -113.091666666667 &lqbooleanOperator=AND -113.840833333333 &lqbooleanOperator=AND -113.454444444444 &lqbooleanOperator=AND -113.454722222222 &lqbooleanOperator=AND -113.454722222222 &lqbooleanOperator=AND -113.734722222222 &lqbooleanOperator=AND -113.734444444444 &lqbooleanOperator=AND -112.75 &lqbooleanOperator=AND -112.75 &lqbooleanOperator=AND -113.7 &lqbooleanOperator=AND -112.669166666667 &lqbooleanOperator=AND -113.364444444444 &lqbooleanOperator=AND -113.702222222222 &lqbooleanOperator=AND -113.0225 &lqbooleanOperator=AND -113.454722222222)"

It does not work. What is wrong with this query?
Karthik J Iyer

Submitted by will on Fri, 2011-05-06 14:51.

It should be OR instead of AND



is part of the URL, not for lq value.

So the full URL should look like this:

 &lq=latitude:(latitude:38.7936111111111 latitude:38.2161111111111 ... longitude:-110.4477 )
Submitted by ramkrs80 on Fri, 2011-05-06 16:50.

I tried with the above options

&lq=latitude:(latitude:38.7936111111111 latitude:38.2161111111111 ... longitude:-110.4477 )

Is the latitude: after lq valid ? would it be just (latitude:38.79 ...) or should that be latitude:(latitude ....) longitude:(longitude:...)

I also tried other options putting ( lat long lat long .....) in that sequence. It did not work..

Submitted by will on Sat, 2011-05-07 09:20.

I am suspecting this would not work with the exact latitude/longitude. Have you even tested on a single point case? Please just verify the lucene query syntax on this lucene query:

 &lq=(latitude:38.7936111111111 AND longitude:-110.4477)

If this works, try adding more points:

 &lq=(latitude:38.7936111111111 AND longitude:-110.4477) OR (latitude:38.7936111111111 AND longitude:-110.4477) ...

Also, another reason that this may fail: the value precision may not be exact match with what's in the index. In this case, you would have to use range query instead of exact match.

Submitted by ramkrs80 on Sun, 2011-05-08 23:25.

The above queries with the latitude:38.7936111111111 AND longitude:-110.4477 for one point and many points do not work.

I also tried using the range query like latitude:(minlat , maxlat) longitude:(minlng , maxlng). its giving me all the points including the points which are not on the above list. I would like it to only fetch the above list of points.

How can I form the query with all the above points as a part of the query. I found that the precision of the decimal points do not matter.

Submitted by will on Mon, 2011-05-09 08:23.

For lq=..., you need to use lucene query syntax.

 latitude:minlat TO maxlat AND longitude:minlng TO maxlng
Submitted by ramkrs80 on Fri, 2011-05-13 00:49.

i would like to know how the google map scaffolding exactly works.. i have played around with the lucene query and tried to query multiple lat and long points but could not get that to work. is there a different way to search the database in dbsight without using http://localhost:8080/dbsight/search.do?indexName=ik_index&lucene=y&templateName=&lqBooleanOperator=OR&lq= this pattern. i am curious to know if i can have more control on the search rather than just append a query string to the above http search string. i am not able to find more documentation related to multiple field search. i am not sure if lucene would work for a search with multiple lat and multiple long points.