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 Norberto Meijome <fr...@meijome.net> on 2008/06/26 17:44:38 UTC

SpellCheckComponent = choosing which one...

Hi there,
I am using the an almost default, config of spellcheck component ( details @ very end of email).  I have the 3 spellcheckers defined, 'default', 'jarowinkler' and 'file'. 

I tried adding spellcheck.name=jarowinkler&spellcheck.build=true  , and with spellcheck.reload=true as well , but:

 - i cannot see any updates in the files in {my_core}/conf/data/spellchecker_jarow directory .

 - I get exactly the same suggestions as with default (which is not really indicative of anything, as I don't know how different they are supposed to be :) )

what am I doing wrong ?

thanks!
B
_________________________
{Beto|Norberto|Numard} Meijome

"A problem cannot be solved with the same type of thinking that created it."
  Albert Einstein

I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.

-----
in solrconfig.xml
<searchComponent name="spellcheck"
		class="org.apache.solr.handler.component.SpellCheckComponent">
		<lst name="defaults">
			<!-- 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>
		<str name="queryAnalyzerFieldType">textSpell</str>

		<lst name="spellchecker">
			<str name="name">default</str>
			<str name="field">spell</str>
			<str name="spellcheckIndexDir">spellchecker_default</str>

		</lst>
		<lst name="spellchecker">
			<str name="name">jarowinkler</str>
			<str name="field">spell</str>
			<!-- Use a different Distance Measure -->
			<str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
			<str name="spellcheckIndexDir">spellchecker_jarow</str>

		</lst>

		<lst name="spellchecker">
			<str name="classname">solr.FileBasedSpellChecker</str>
			<str name="name">file</str>
			<str name="sourceLocation">spellings.txt</str>
			<str name="characterEncoding">UTF-8</str>
			<str name="indexDir">spellcheckerFile</str>
		</lst>
	</searchComponent>

	<queryConverter name="queryConverter"
		class="org.apache.solr.spelling.SpellingQueryConverter" />

	<requestHandler name="/spellCheckCompRH"
		class="org.apache.solr.handler.component.SearchHandler">
		<arr name="last-components">
			<str>spellcheck</str>
		</arr>
	</requestHandler>
---

Re: SpellCheckComponent = choosing which one...

Posted by Norberto Meijome <fr...@meijome.net>.
On Fri, 27 Jun 2008 01:44:38 +1000
Norberto Meijome <fr...@meijome.net> wrote:

> I am using the an almost default, config of spellcheck component ( details @ very end of email).  I have the 3 spellcheckers defined, 'default', 'jarowinkler' and 'file'. 
> 
> I tried adding spellcheck.name=jarowinkler&spellcheck.build=true  , and with spellcheck.reload=true as well , but:
> 
>  - i cannot see any updates in the files in {my_core}/conf/data/spellchecker_jarow directory .
> 
>  - I get exactly the same suggestions as with default (which is not really indicative of anything, as I don't know how different they are supposed to be :) )

Furthermore, I rm -rf the data directory. I issued a build & reload with spellcheck.name=jarowinkler, and the index in spellchecker_default got updated. 

Is it because both spellcheckers point to the same field +  the indexing is the same for both spellcheckers, only the distance measurement is different => a SOLR / Lucene optimisation kicks in to only maintain 1 index? 

cheers,
B
_________________________
{Beto|Norberto|Numard} Meijome

"Build a system that even a fool can use, and only a fool will want to use it."
   George Bernard Shaw

I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.