Given the following set of values, how do I set up a field to return values that are partial matches of words but that also match the entire search query?
values:
Texas State University
Stanford University
St. Johns College
Examples of desired results:
Search term: sta
Desired Results:
Texas State University
Stanford University
Search term: stan
Desired Results:
Stanford University
Search term: st un
Desired Results:
Texas State University
Stanford University
This is what I have tried so far:
<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/>
</analyzer>
</fieldType>
I think my problem is related to EdgeNGramFilterFactory. As shown above, the second search stanreturns all three values shown instead of only Stanford. But, without EdgeNGramFilterFactory, partial words do not match at all.
What is the correct configuration for the Solr field to return values that are partial matches of words, but which also match the entire search query?