I\'ve looked through a ton of examples and other questions here and from them, I\'ve got my config very close to what I need but I\'m missing one last little bit that I\'m havin
I've tried this many times and I came to the conclusion that is not possible out of the box. I found a workaround for that:
I indexed the data adding sopecial chars between each word so that they would not be tokenized. For example:
solarzzzzzzpowered
solarzzzzzzglass
solarzzzzzzglobe
then when you compose your query you make sure you add the same amount of chars between the two words you type, for example solr gl
become solarzzzzzzgl
.
This will achieve the behavious that you are asking.
Another option would be not to use the autosuggestion field and make a custom field for yourself, but then you will have to manage the wildcard search and all the indexation by yourself and is not too convenient in terms of time and performance.
Found the answer, finally! I knew I was really close. Turns out my configuration above was correct and I simply needed to change my query.
KeywordTokenizerFactory
so that the strings get indexed as a whole.SpellCheckComponent
for the request handler.q=<string>
but with spellcheck.q=<string>
.Given the source strings noted above and a query of spellcheck.q=solar+gl
this yields the desired results:
solar glass
solar globe
You may use the AnalyzingInfixLookupFactory
or FreeTextLookupFactory
More details and other suggester algorithms you will find here: http://alexbenedetti.blogspot.de/2015/07/solr-you-complete-me.html
Solr Configuration
<lst name="suggester">
<str name="name">AnalyzingInfixSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">title</str>
<str name="weightField">price</str>
<str name="suggestAnalyzerFieldType">text_en</str>
</lst>
<lst name="suggester">
<str name="name">FreeTextSuggester</str>
<str name="lookupImpl">FreeTextLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">title</str>
<str name="ngrams">3</str>
<str name="separator"> </str>
<str name="suggestFreeTextAnalyzerFieldType">text_general</str>
</lst>