frequency - Elasticsearch how to return the number of maching term for each document -
i'm new elasticsearch , i'm interested in how possible retrieve number of matching term inside each document processed. know can score, i'm looking number of matches each document, possible?
edit after mguillermin answer
what looking query index, , receive @ same time tf on each document result, , not find term frequency of single document
thanks
for checking single document, can retrieve kind of information using explain api
: http://www.elasticsearch.org/guide/reference/api/explain/
if need information collected along query results, can add "explain": true
body sent _search
. ex :
{ "explain": true, "query": { "term": { "description": "test" } } }
with parameter, each hit
associated _explanation
data. ex :
"_explanation": { "value": 1.4845161, "description": "fieldweight(description:test in 63), product of:", "details": [ { "value": 1, "description": "tf(termfreq(description:test)=1)" }, { "value": 5.9380646, "description": "idf(docfreq=23, maxdocs=3348)" }, { "value": 0.25, "description": "fieldnorm(field=description, doc=63)" } ] }
Comments
Post a Comment