lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Karich <peat...@yahoo.de>
Subject Re: Spell-Check Component Functionality
Date Thu, 18 Nov 2010 14:39:08 GMT
  Hi Rajani,

some notes:
  * try spellcheck.q=curst or completely without spellcheck.q but with q
  * compared to the normal q parameter spellcheck.q can have a different 
analyzer/tokenizer and is used if present
  * do not do spellcheck.build=true for every request (creating the 
spellcheck index can be very expensive)
  * if you got spellcheck working embed the spellcheck component into 
your normal query component. otherwise you need to query 2 times ...

Regards,
Peter.

> All,
>
>      I am trying apply the Solr spell check component functionality to our
> data.
>
> The configuration set up I needed to make for it by updating config.xml and
> schema.xml is done as follows..
> Please let me know if any errors in it.
>
>   I am not getting any suggestions in suggestion tags of solr output xml.
>
> I indexed word "Crust" to the field textSpell that is enabled for spell
> check and then I searched for
> "Curst"
>
> The queries i tried were :
> http://localhost:8909/solr/spell?q=Curst&spellcheck=true&spellcheck.collate=true&spellcheck.build=true&spellcheck.q=true
>
> http://localhost:8909/solr/spell?q=Cruste&spellcheck=true&spellcheck.collate=true&spellcheck.build=true&spellcheck.q=true&spellcheck.dictionary=default
>
>
> The CONFIG.XML :
>
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>      <lst name="spellchecker">
>        <str name="name">default</str>
>        <str name="field">spell</str>
>        <str name="spellcheckIndexDir">./spellchecker</str>
>      </lst>
>
>      <!-- a spellchecker that uses a different distance measure -->
>      <lst name="spellchecker">
>        <str name="name">jarowinkler</str>
>        <str name="field">lowerfilt</str>
>        <str
> name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
>        <str name="spellcheckIndexDir">./spellchecker2</str>
>      </lst>
>       <str name="queryAnalyzerFieldType">textSpell</str>
> </searchComponent>
>
> <requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
>      <lst name="defaults">
> <str name="spellcheck.dictionary">default</str>
>        <!-- omp = Only More Popular -->
>        <str name="spellcheck.onlyMorePopular">false</str>
>        <!-- exr = Extended Results -->
>        <str name="spellcheck.extendedResults">false</str>
>        <!--  The number of suggestions to return -->
>        <str name="spellcheck.count">1</str>
>      </lst>
>      <arr name="last-components">
>        <str>spellcheck</str>
>      </arr>
>    </requestHandler>
>
>
>
> SCHEMA:
>
> <fieldType name="textSpell" class="solr.TextField"
> positionIncrementGap="100">
>    <analyzer type="index">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> </analyzer>
>    <analyzer type="query">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.StandardFilterFactory"/>
> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> </analyzer>
> </fieldType>
>
>
> <field name="spell"  type="textSpell"  indexed="true" stored="true" />
>
>
> If any error in above that is not enabling spell check please let me know.
>
> The output I am getting is like null  suggetions
>
> <lst>
> <Suggesstions/>
> </lst>
>
>
> Regards,
> Rajani Maski
>


-- 
http://jetwick.com twitter search prototype


Mime
View raw message