Re: problem in using distanceFilter in booleanFilter (using FilterClause)

2014-04-09 Thread david.w.smi...@gmail.com
You'll be lucky to get help with the spatial module from Lucene 3.x, which is what you are using. It was outright replaced in 4.0 because it was buggy. p.s. please don't blast emails to multiple lists Good luck, ~ David On Thu, Apr 10, 2014 at 1:58 AM, kumaran wrote: > > Hi All, > > i am try

Re: problem in using distanceFilter in booleanFilter (using FilterClause)

2014-04-11 Thread david.w.smi...@gmail.com
I suggest either finding example code out there (try googling) or https://code.ohloh.net and/or looking at any tests which can often serve as illustrative examples. Failing those approaches; grab a coffee and break out the debugger. This is fairly generic advise, I admit, but it's all I have to

Re: Lucene Spatial Question: How to retrieve all results within a bounding box?

2014-06-08 Thread david.w.smi...@gmail.com
Hi. Your question is actually not particularly spatial; it’s more circumstantial to your particular query. You want to know how to do a query and collect *all* the results, in no particular order. To do this efficiently, you need to use a Collector. Also, I noticed you are using the “IsWithin” p

Re: Lucene Spatial Question: How to retrieve all results within a bounding box?

2014-06-08 Thread david.w.smi...@gmail.com
Yes; as I said in my last sentence: "You’ll see a difference of Document vs StoredDocument with 4x”. As to SimpleCollector not being in 4x (I didn’t check but I’ll take your word for it) — the bottom line is that you need to write a Collector, and a simple one at that. ~ David Smiley Freelance Ap

Re: Lucene Spatial Question: Is a tree structure explicitly created in the QuadPrefixTree implementation?

2014-10-01 Thread david.w.smi...@gmail.com
Hi Parth, Lucene’s “terms dictionary” (an inverted index) is the physical instantiation of the actual PrefixTree/Trie for numeric and spatial data. It doesn’t know it is — it’s just a sorted list of keys pointing to matching documents — it just so happens that the keys aren’t textual words in this

Re: Lucene Spatial Question: Is there a primary and a secondary filter?

2014-10-02 Thread david.w.smi...@gmail.com
Hi Parth, Since Lucene 4.7 spatial, there is a “SerializedDVStrategy” for serialized geometries. It’s used as a second-pass after RPT (or perhaps BBoxStrategy). There was a presentation at FOSS4G about it (I was there and helped with this one too): http://vimeo.com/106843184 There’s a small code

Re: Lucene spatial for grid clusters

2014-11-06 Thread david.w.smi...@gmail.com
FYI I plan to implement this in Lucene-spatial & Solr in January. ~ David Smiley Freelance Apache Lucene/Solr Search Consultant/Developer http://www.linkedin.com/in/davidwsmiley On Wed, Nov 5, 2014 at 10:52 PM, Shahak Nagiel wrote: > I need a way to perform a spatial aggregation query against a

Re: Lucene spatial for grid clusters

2014-11-06 Thread david.w.smi...@gmail.com
t your > planned implementation? > > > On Thursday, November 6, 2014 8:11 AM, "david.w.smi...@gmail.com" < > david.w.smi...@gmail.com> wrote: > > > FYI I plan to implement this in Lucene-spatial & Solr in January. > > ~ David Smiley > Free

Re: A question on implementing new operators

2014-12-02 Thread david.w.smi...@gmail.com
Hi Prasad, Firstly, the Lucene ‘general’ list is not the appropriate list; it’s the java-user lucene list so I’m replying there instead. This is mostly about query parsing. If you look at Lucene’s modules, you’ll see a “queryparser” module. In there, there’s a “flexible” package which is named

Re: Lucene Spatial Implementation for Points within Polygon.

2014-12-22 Thread david.w.smi...@gmail.com
Hello. You have stated the use-case so generically that it’s not clear if you should index the polygon set and query by the point set, or the reverse. Generally, you should index the set that is known in-advance and then query by the other, the set that is generally not known. Assuming this is th

Re: Distance between 2 points Lucene Spatial

2014-12-22 Thread david.w.smi...@gmail.com
Hi Ankit, Vincenty is the most accurate one — it is the benchmark for the other 2’s tests for the true answer. In theory it produces the same answers as the other 2 simpler formulas you mention but is “numerically robust” for computers. Note that the world model used by Spatial4j when in “geo” m

Re: Distance between 2 points Lucene Spatial

2014-12-22 Thread david.w.smi...@gmail.com
of Vincenty. > > However, I do not intend to use GeoDesy. > > I would prefer to use inbuilt Vincenty of Lucene to get the distance in > metres but I am unable to find this. > > Please suggest. > > > -Original Message- > From: david.w.smi...@gmail.com [mailto

Re: Lucene Spatial Implementation for Points within Polygon.

2014-12-24 Thread david.w.smi...@gmail.com
gon which is present(boundaries intersecting,incomplete), I am printing > exception which is again I am excluding.. This is not the worry.. > > Worry is I am getting very polygons which actually have points inside them. > > Please correct me where I am going wrong. > > > -Ori

Re: Searching for DateRangeField in Lucene 5.0.0

2015-02-25 Thread david.w.smi...@gmail.com
Yeah, Uwe has it basically right. I was on vacation when the release notes were developed and missed the opportunity to review them before they were published. This bullet references “DateRangeField” but that’s the Solr side of this feature. The Lucene side is the combination of NumberRangePrefi

Re: Can't get distance sorting to work in Lucene Spatial 4.10.3

2015-02-25 Thread david.w.smi...@gmail.com
Hi Rainer, I see two issues. One is that you call makePoint with latitude (Y) then longitude (X). Spatial4j is X then Y order. The second issue is more stylistic (but in this case it may explain your symptom due to the X & Y mixup) is that, since you already have a ‘point’, when you call makeCi

Re: Time range facets on documents associated with a time interval

2015-03-25 Thread david.w.smi...@gmail.com
Hi Rainer, If Solr is an option, then as of 5.0 you can use “DateRangeField” and use Solr’s standard faceting on that. If this is at the Lucene level, you can do the same approach as Solr — use NumberRangePrefixTreeStrategy configured with a DateRangePrefixTree. Then for each interval, generate

Re: Spatial Search with Nested Polygons

2015-03-26 Thread david.w.smi...@gmail.com
Hi Mike, The second, (non-easy) part seems like it could be pretty slow: Additionally, I'd like to have access to the > numerical value of the smallest polygon which contains the point > (something like makeDistanceValueSource). To determine “the smallest polygon which contains the point” for t

Re: Spatial Search with Nested Polygons

2015-03-27 Thread david.w.smi...@gmail.com
On Fri, Mar 27, 2015 at 12:27 AM, Mike Hansen wrote: > There are a few things which could probably help with performance. > Each document has only around say 30 polygons. You could do a binary > search which would help reduce the cost. Additionally, I have a > distinguished point contained inside

Re: question about spatial module in lucene 5

2015-03-30 Thread david.w.smi...@gmail.com
I Anton. I think you’re right. PointVectorStrategy has been overlooked. The work-around is pretty simple though. In addition to calling createIndexableFields, also create two DoubleDocValuesField instances, one for each dimension that uses the identical names the strategy generates. Lucene will

Re: Lucene Spatial: sorg by best fit

2015-04-01 Thread david.w.smi...@gmail.com
Hi Rainer, The BBoxStrategy is pretty close to this. It does assume indexed rectangles and not other shapes, and it’s limited to one rect value per field, but perhaps this is fine for you nonetheless? See the makeOverlapRatioValueSource() method. If this feature was non-obvious, I think I may n

Re: Lucene Spatial: sort by best fit

2015-04-01 Thread david.w.smi...@gmail.com
On Wed, Apr 1, 2015 at 3:21 PM, Simon Rainer wrote: > Hi David, > > ouch - no, missed that. I'm indexing points and polygons with the > RecursivePrefixTreeStrategy right now, so simply didn't look properly at > the BBoxStrategy. (I need to use exact polygons, so that I can make use of > the ultra

Quiz question: Which Character.isSpaceChar but not isWhitespace?

2015-10-30 Thread david.w.smi...@gmail.com
One would think that all “space characters” are by definition “whitespace”. Not true!: http://www.fileformat.info/info/unicode/char/00a0/index.htm So I’m working on an app where I can no longer use WhitespaceTokenizer since I need to check for isSpacheChar *OR* isWhitespace. Alternatively I coul

Re: [spatial] Indexing polygons?

2016-01-10 Thread david.w.smi...@gmail.com
Hi Robert, First, for the basics of the spatial module, see SpatialExample.java in the tests area. It doesn't include a polygon example but shows the concepts of a SpatialContext, Shape, and SpatialStrategy which are the key abstractions. The default SpatialContext implementation doesn't handle

Re: Is MemoryIndex and Spatial stuff combination supported?

2016-01-20 Thread david.w.smi...@gmail.com
Yup. Just to clarify for the O.P., after getting the SpatialStrategy instance, call createIndexableFields() which returns a list of Field instances, which you can then call tokenStream() on as Alan indicated. This should work fine for any of the SpatialStrategy instances. On Wed, Jan 20, 2016 at