I had the same project requirement. I had to implement the proposal. What I did was define this fieldType argument
<fieldType class="solr.TextField" name="suggester"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="3" outputUnigrams="true" outputUnigramsIfNoShingles="false" /> <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt" enablePositionIncrements="true" /> </analyzer> <analyzer type="query"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
I used ShingleFilterFactory because I needed to get a sentence consisting of one or more words.
Then I used facies queries to get offers.
Facet.Limit = 10
Facet.Prefix = "Book"
Facet.Field = "Suggestester" // this is a field with fieldType = "summester" in which I saved the data
I know that it uses the results of the face, but maybe it solves your problem.
If my or Jayendra Patil's answer does not provide you with a solution, you can also take a look at EdgeNGramFilterFactory
Dorin source share