Solr offers an exact match

I am trying to make solr return an exact match on a sentence, for example:

  • spellcheck.q = tota strong> returns totals in the results, but
  • spellcheck.q = total does not return totals in the results.

I use this field for suggestions:

<fieldType name="textSpellShingle" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.ShingleFilterFactory" maxShingleSize="3" outputUnigrams="true"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> </fieldType> 

Any idea how to make Solr return exact matches on the prompt ??

+5
source share
4 answers

You are using the SpellChecker component, which, as indicated in the name, is intended for spell checking. It returns suggestions about how the recording should be recorded. When a word is spelled correctly (which is equal to an exact match), it does not return anything, which is the reason that you do not see the word in the list.

Since Solr 4.7, a new offer component has been added, which is actually implemented for autostarts and gives the expected results.

+1
source

can try with this

 <fieldType name="textSpellShingle" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="50" side="front"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="50" side="back"/> </analyzer> </fieldType> 
0
source

As mentioned on this wiki page: https://cwiki.apache.org/confluence/display/solr/Suggester

To be used as the basis for a suggestion, the field must be stored.

Make sure your field is saved. The field is not stored, so it returns data compressed by your index.

0
source

Your problem arose because you used the old sentence component based on the spellchecking component (I suppose you used solr version up to 5).

With an old spelling check / sentence, if a word match does not come back!

Test with solr.suggestComponent (if present in your version).

see https://cwiki.apache.org/confluence/display/solr/Suggester

-1
source

All Articles