I've written a native script plugin to elasticsearch that extends
AbstractSearchScript. My code grabs a handle to the
org.apache.lucene.index.IndexReader and the docId. It then uses the
IndexReader to fetch the term vector for the docId, the frequency of each
term within the document, and the number of documents containing that term.
All of that data is then stored in a json string which is sent back to the
code performing the query.
We're currently on elasticsearch 0.20.5 (slightly old). I'm using the
following IndexReader call to get the document count:
I'm pretty sure my code will need to change when we upgrade to the latest
elasticsearch as the Lucene IndexReader methods appear to have changed. No
My question: Is reader.docFreq() shard-aware? I'm assuming not. I'm
assuming I'll only get the document count within the current shard.
If my assumption is correct, is there a way to get the document count for a
term across all shards? Is there a way for my code to access the
IndexReader's for the other shards? If there were, then I could just call
reader.docFreq() for each shard and add the results.
(I'd happily upgrade to the latest elasticsearch if it makes it easier to
solve this problem.)
Thanks for any help.
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 firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.