My suggestion is pretty much language-independent. My previous experience
was based on a C++ database engine I wrote (ElasticSearch blows it away in
the area of updates and smooth cluster replication; I blew away Lucene in
the areas of performance, phrases with wildcards, tock-solid bug-free geo
shapes, and hierarchy support. I would love to marry ElasticSearch with my
non-Lucene indexing magic, but that's a discussion for another day!) and
that C++ code is no longer available to me (but the ideas are!).
But the code (in whatever language you wish) should be pretty simple. The
important concept is that your documents contain two multi-valued fields,
and that the relationship between the values in each of those fields is
handled by your application (load, and query) and not internal to
ElasticSearch. For some index N, the value of field1[N] corresponds to the
value of field2[N].
In my previous experience, I had one lat and lon pair for each document,
but across the hierarchy there could be many, many documents that matched
the query. So I collected the lat and lon values from the related documents
for a hierarchy. I was left with two arrays of the same size (lat and
lon). I would apply each pair of lat[N], lon[N] to the geo index and geo
filter (either circle or generic polygon) and if any of the pairs was
within the range the documents from that hierarchy were kept (in general,
of course). And as I was determining the inclusion, I also updated the
document (in the response, not on disk) with the calculated distance; this
enabled a sort by (smallest) distance and also enabled the client to
highlight the smallest distance so it was easy to see which distance caused
the sorting placement of the hierarchy's returned documents.
On Monday, May 13, 2013 3:37:25 AM UTC-4, Waldemar Ch. wrote:
Could you provide some code example?
Because I have tested everything what's on internet, and without success.
Maybe I'm doing something wrong?
PS. Thanks for your idea, I will check that in next few day (now too many
responsibilities), and come back with results .
W dniu 2013-05-10 18:59, InquiringMind pisze:
Just a thought.... it's worked well for me in a past life when creating
arrays of [ lat, lon ] pairs but the database only supported multivalued
fields of basic types but not complex types.
"Availability_Period" : [ "2013-06-05|2013-05-09",
"Availability_Price" : [ 53.37, 106.75 ]
The two arrays are related by position. For example, Availability_Period[
n] corresponds to Availability_Price[n].
Might this help? Just a thought...
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.