There is no option to get score of specific nested doc, though it has been requested to be able to return "only" the nested doc that matched the query, in which case we can possibly return the score with it. This is a very "up in the air" feature currently, not slated (or even designed) yet.
Regarding the "get" API pert, its not a btree, it will probably be a bit faster then a btree. Thats because there is a bloom filter associated with each segment, so getting a doc will almost all times find the relevant segment, and then within that segment (a segment is part of an index) its more similar to an interval based skip list.
On Aug 6, 2012, at 3:04 PM, Zachary Tong email@example.com wrote:
Looks like I found my answer here:
Guess I'll start down the denormalization path. IF anyone has some comments or opinions on the best way to structure relationships in ES, I'd love to hear. Is the general sentiment to not model relationships and simply retrieve IDs which you use through another, non-ES mechanism to find (say, query a database) ?
Related, what's the performance of simply looking up a specific document by it's ID? Is it O(n)? Does ES use something like b-trees for document ID lookups?
On Sunday, August 5, 2012 7:52:54 PM UTC-4, Zachary Tong wrote:
I believe the answer is "no", but wanted to check:
Is there a way to return the individual score of the nested documents that match a query? I'm performing a query on nested docs which returns appropriate parents, but I would like to know which nested child scored the highest for the query. The nested score_mode simply tells me that "one of the children scored well", but not which one. Is there any way to sort or find the score of the nested children?
Barring that, I'm not certain of the best way to structure my data. Should I arrange the data in two types and denormalize so that one type has a "foreign key" (to use relational db terminology) that points at the other type, which would then require several more queries to access the individual documents?