elasticsearch-river-web icon indicating copy to clipboard operation
elasticsearch-river-web copied to clipboard

Facet issue

Open vittaboina opened this issue 11 years ago • 2 comments

{ "query" : { "query_string" : {"query" : "ck3"} }, "facets" : { "tags" : { "terms" : {"fields" : ["metakey","metaprod","metasol","metares"]} } } }

Printers and Media is a single word in meta tag content attribute. When i run this code then its giving me the counts in such a way that if the word is 'Printers and Media' then its giving me as { term:"printers", count:280 }, { term:"and", count : 300 } { term:"media", count:100 }

But i need as { term:"Printers and Media" count:200 }

like this what would be the changes i need to do in the query.Please suggest.

Thanks in advance.

vittaboina avatar Mar 25 '14 09:03 vittaboina

As per our requirement separation should be done on occurance of ", "(comma space). Is it possible to handle in query, unlike provided by default.

vittaboina avatar Mar 25 '14 13:03 vittaboina

"metakey","metaprod","metasol","metares"

If you use them as facet, you need to specify not_analyzed field in the mapping.

", "(comma space)

I think that it's difficult to handle in query. You can convert extracted value by script in crawling. https://github.com/codelibs/elasticsearch-river-web#rewrite-a-property-value-by-mvel

marevol avatar Mar 25 '14 14:03 marevol