Hello Sir,
I want count of keyword occurance in a particular file in elaticsearch .
ok Sir thaks for the reply i will check.
I have used below query
GET index_name/_mtermvectors
{
"ids" : ["1", "2"],
"parameters": {
"fields": ["file.filename"],
"term_statistics": true,
"offsets":false,
"payloads":false,
"positions":false
}
}
But giving found false. Can you please share any example .
I want to count a particular word occur means "php" how many times in a particular filea.pdf like.
Look this example:
POST idx_test/_doc/1
{
"text":{
"file": "I read and read a text english"
}
}
GET idx_test/_mtermvectors
{
"ids": [
"1"
],
"parameters": {
"fields": [
"text.file"
]
}
}
Output
{
"docs" : [
{
"_index" : "idx_test",
"_type" : "_doc",
"_id" : "1",
"_version" : 1,
"found" : true,
"took" : 458,
"term_vectors" : {
"text.file" : {
"field_statistics" : {
"sum_doc_freq" : 6,
"doc_count" : 1,
"sum_ttf" : 7
},
"terms" : {
"a" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 4,
"start_offset" : 16,
"end_offset" : 17
}
]
},
"and" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 2,
"start_offset" : 7,
"end_offset" : 10
}
]
},
"english" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 6,
"start_offset" : 23,
"end_offset" : 30
}
]
},
"i" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 0,
"start_offset" : 0,
"end_offset" : 1
}
]
},
"read" : {
"term_freq" : 2,
"tokens" : [
{
"position" : 1,
"start_offset" : 2,
"end_offset" : 6
},
{
"position" : 3,
"start_offset" : 11,
"end_offset" : 15
}
]
},
"text" : {
"term_freq" : 1,
"tokens" : [
{
"position" : 5,
"start_offset" : 18,
"end_offset" : 22
}
]
}
}
}
}
}
]
}
okay sir. Thank you so much I will try.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.