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 the current matching document, you’d have to iterate over them in smallest-to-largest-1 order and check containment, so that you know which corresponding value to return. There will be a performance hit for sure. This sounds like a custom ValueSource/FunctionValues that does that logic… perhaps by grabbing the shapes from SerializedDVStrategy’s shape providing ValueSource. If you provide the shapes using a Spatial4j ShapeCollection with the order from biggest to smallest, you can know the index of which shape matches, and then pull the i-th numeric value you need from a list of numbers in BinaryDocValues. The largest shape could be kept out of here since you don’t need it. ~ David Smiley Freelance Apache Lucene/Solr Search Consultant/Developer http://www.linkedin.com/in/davidwsmiley On Thu, Mar 26, 2015 at 11:47 PM, Mike Hansen <mhan...@gmail.com> wrote: > I was wondering about the feasibility / difficultly of implementing a > solution to the following problem with Lucene. > > For each document, I have a series of nested polygons each associated > with a numerical value. My search query gives a point, and I want to > return all of the documents whose largest polygon contains the point > (that part is easy). Additionally, I'd like to have access to the > numerical value of the smallest polygon which contains the point > (something like makeDistanceValueSource). > > Thanks, > --Mike > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >