You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Hakim Benoudjit <h....@gmail.com> on 2015/03/18 17:15:15 UTC

Multiple words suggestion

Hello there,

Does Solr 4.x (or even 5) support *multiple words suggestions*?
I mean if my query is: "*tozota hilox*":
And when I activate the spellcheck component, each word is treated
separately.

So "*toyota*" is suggested for "*tozota*", and "*hilux*" is suggested for "
*hilox*".
But what I need to have is a complete suggestion for all the query:
i.e. "*toyota
hilux*" which will be suggested when the user's query is "*tozota hilox*".

Please see below the *suggest component *from my *solrconfig.xml *(I
changed only the *field*):










































*<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">text_general</str>    <!-- Multiple
"Spell Checkers" can be declared and used by this         component
-->    <!-- a spellchecker built from a field of the main index -->    <lst
name="spellchecker">      <str name="name">default</str>      <str
name="field">recherche</str>      <str
name="classname">solr.DirectSolrSpellChecker</str>      <!-- the spellcheck
distance measure used, the default is the internal levenshtein -->
<str name="distanceMeasure">internal</str>      <!-- minimum accuracy
needed to be considered a valid spellcheck suggestion -->      <float
name="accuracy">0.5</float>      <!-- the maximum #edits we consider when
enumerating terms: can be 1 or 2 -->      <int name="maxEdits">2</int>
<!-- the minimum shared prefix when enumerating terms -->      <int
name="minPrefix">1</int>      <!-- maximum number of inspections per
result. -->      <int name="maxInspections">5</int>      <!-- minimum
length of a query term to be considered for correction -->      <int
name="minQueryLength">4</int>      <!-- maximum threshold of documents a
query term can appear to be considered for correction -->      <float
name="maxQueryFrequency">0.01</float>      <!-- uncomment this to require
suggestions to occur in 1% of the documents          <float
name="thresholdTokenFrequency">.01</float>      -->    </lst>        <!-- a
spellchecker that can break or combine words.  See "/spell" handler below
for usage -->    <lst name="spellchecker">      <str
name="name">wordbreak</str>      <str
name="classname">solr.WordBreakSolrSpellChecker</str>            <str
name="field">recherche</str>      <str name="combineWords">true</str>
<str name="breakWords">true</str>      <int name="maxChanges">10</int>
</lst>*
*</searchComponent>*

-- 
Cordialement,
Best regards,
Hakim Benoudjit