Данные испытаний:
curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '{ "body": "this is a test" }'
curl -XPUT 'localhost:9200/customer/external/2?pretty' -d '{ "body": "and this is another test" }'
curl -XPUT 'localhost:9200/customer/external/2?pretty' -d '{ "body": "this thing is a test" }'
Моя цель - получить частоту фразы в документе.
Я знаю, как получить частоту терминов в документе:
curl -g "http://localhost:9200/customer/external/1/_termvectors?pretty" -d'
{
"fields": ["body"],
"term_statistics" : true
}'
И я знаю, как посчитать документы, содержащие заданную фразу (с запросом match_phrase или span_near):
curl -g "http://localhost:9200/customer/_count?pretty" -d'
{
"query": {
"match_phrase": {
"body" : "this is"
}
}
}'
Как я могу получить доступ к частоте фразы?