On Wed, 2011-11-30 at 19:19 +0530, Vineeth Mohan wrote:
Hi ,
If i run term facet on a particular field , i am getting the result of
terms after splitting the filed WRT space.
This is correct - your field is being analyzed so what is stored is the
result of that analysis (ie 'mr', 'king', 'kong', etc)
If you want the original phrase to be preserved, then you should map
that field to have {"index": "not_analyzed"}
However, that has implications for searching too, because you then
wouldn't be able to search for "king".
If you want to be able to do both, then you should use multi-fields,
with one sub-field analyzed (for searching), and one sub-field not
analyzed (for facets)
clint
For eg :
If the fields are - "Mr King","King Kong","Mr CEO","CEO OF" , "Mr
King"
After running term facet on this{
"facets": {
"Categories": {
"terms": {
"field": "Name",
"size": 10
}
}
}
}Am getting the result as
"Mr" - 3
"King" - 3
Kong - 1
CEO - 2
OF -1What i expected was
"Mr King" - 2
"King Kong"-1
"Mr CEO" - 1And so on...
Is this the right behavior.
If it is , what is the other alternative to the desired output.Thanks
Vineeth