I am querying a simple core of category names, e.g.
- JEANS
- SKINNY JEANS
- BOOT CUT JEANS
- SHOES
- ...
I typically use EDisMax. I would like the user query, for example:
BLUE SKINNY JEANS
to match only exact categories. So in the above case only the following should match:
- SKINNY JEANS
- JEANS
I'm using Solr 5.3.1. I tried to implement the category "name" field as a string type, and I query with the following params:
"params": {
"q": "SKINNY JEANS",
"defType": "edismax",
"indent": "true",
"qf": "name",
"pf": "name",
"pf3": "name",
"wt": "json",
"pf2": "name",
"lowercaseOperators": "true",
"debugQuery": "true",
"stopwords": "true",
"_": "1464079436985"
}
but only JEANS is ever matched. I cannot, for the life of me, get SKINNY JEANS to match.
I am getting more familiar with Solr's analysers, I tried generating the following type as a way to get around the problem:
fieldType name="text_phrase" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.TrimFilterFactory" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.TrimFilterFactory" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
I.e. using a KeywordTokenizerFactory to index the category name without tokenizing, but tokenizing the query in conjunction with EDisMax's pf/pf2/pf3 fields, but this does not work either. I don't think shingles are a solution here, and PositionFilterFactory appears deprecated.
How do I EDisMax query a large string for a smaller substring?
Thank you,