Unable to give


(yashwantborse) #1

Hi ,
I implemented the elasticsearch facet in java, when I search a particular field (by using termQuery) eg title then it only give the first word of title by using termfacet. please help me.
The output of searchresponse and hits are ,

Searchresponse {
"took" : 125,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.2702225,
"hits" : [ {
"_shard" : 0,
"_node" : "NG7CXPXzSi-ziA-8gU_ApQ",
"_index" : "test",
"_type" : "doc",
"_id" : "3",
"_score" : 1.2702225, "_source" : {"file":"title :XML Developer's Guide"},
"_explanation" : {
"value" : 1.2702225,
"description" : "fieldWeight(file:title in 2), product of:",
"details" : [ {
"value" : 1.0,
"description" : "tf(termFreq(file:title)=1)"
}, {
"value" : 2.540445,
"description" : "idf(docFreq=2, maxDocs=14)"
}, {
"value" : 0.5,
"description" : "fieldNorm(field=file, doc=2)"
} ]
}
}, {
"_shard" : 0,
"_node" : "NG7CXPXzSi-ziA-8gU_ApQ",
"_index" : "test",
"_type" : "doc",
"_id" : "10",
"_score" : 1.2702225, "_source" : {"file":"title :Midnight Rain"},
"_explanation" : {
"value" : 1.2702225,
"description" : "fieldWeight(file:title in 9), product of:",
"details" : [ {
"value" : 1.0,
"description" : "tf(termFreq(file:title)=1)"
}, {
"value" : 2.540445,
"description" : "idf(docFreq=2, maxDocs=14)"
}, {
"value" : 0.5,
"description" : "fieldNorm(field=file, doc=9)"
} ]
}
} ]
},
"facets" : {
"facet1" : {
"_type" : "terms",
"missing" : 0,
"total" : 7,
"other" : 0,
"terms" : [ {
"term" : "title",
"count" : 2
}, {
"term" : "xml",
"count" : 1
}, {
"term" : "rain",
"count" : 1
}, {
"term" : "midnight",
"count" : 1
}, {
"term" : "guide",
"count" : 1
}, {
"term" : "developer's",
"count" : 1
} ]
}
}
}
Total hits are 6
xml(1)
rain(1)
midnight(1)
guide(1)
developer's(1)


(system) #2