0
votes

I am creating a front end application which queries through a database using the Apache Solr engine, but I have two issues that I just cannot find the answer to.

When Solr is processing a Facet query, how do I get the facet to be a single phrase ("Department of the Navy (160)") instead of a broken up facet of 4 terms ("Department (160)" "of (200)" "the (200)" "Navy(160)").

Also, how do I remove certain facets from being queried, for example "and" "to" "the" etc.

Thank you.

1
What is the data type of the phrase, and how were you indexing?Ramzy
@Ramzy The data type of the phrase was text, but I just made a duplicate field in the schema.xml file and made it of type string instead of text and it picked up the entire field without slicing it up. Got it working now!! :)aishaq11

1 Answers

0
votes

Looks like your phrase is being indexed into a Text field which, among many things, splits by whitespace. This is very good for full text search but not for faceting.

You can have a duplicate field for this, of type string (and not Text), which is not splitted. You can still use the original field for searching but the new string field for faceting.