How to facet phrases in solr?

Lately i have been trying to apply facet to a field with some values having multiple words(a phrase)? I have been suggested to use shingles but am not sure if that would work as expected as the required phrase should be taken from a given list.

For example: when i apply facet to a field, i get seperate facets for 'Information' and 'Technology' whereas i want it to be a single facet like 'Information Technology'.

How to facet a particular phrase in a particular field?

EDIT: The schema for the required field looks like this:




The shingles filter doesn't work, as it shows three facets for Information technology: information, technology and information technology.

asked May 16, 2015 in SOLR by rajesh
0 votes

1 Answer

0 votes
Best answer
The problem seems to be that the facet field words are being split in the index, by the analyzers. If you want to facet on fields which has potentially multiple words then we should use the analyzers which does not split the words. It can be "copy field" in solr so that your indexing process doesn't really change. For example you could have something like below.

Use the above field in your facet query.
answered May 16, 2015 by rajesh