Inline below
On Jun 21, 2008, at 5:28 PM, Ronald K. Braun wrote:
2. I'm having difficulty getting the FileBasedSpellChecker to work --
probably something silly on my part but given the above I thought
there might be container differences that haven't been vetted. Here
is my config:
<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">spell</str>
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">dictionary</str>
<str
name="classname">org.apache.solr.spelling.IndexBasedSpellChecker</str>
<str name="spellcheckIndexDir">spellchecker</str>
</lst>
<lst name="spellchecker">
<str
name="classname">org.apache.solr.spelling.FileBasedSpellChecker</str>
<str name="name">external</str>
<str name="sourceLocation">spellings.txt</str>
<str name="characterEncoding">UTF-8</str>
<str name="spellcheckIndexDir">spellchecker2</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>
spellings.txt contains:
pizza
history
http://localhost/solr/spellCheckCompRH?spellcheck=true&q=pizzza&spellcheck.dictionary=default&spellcheck.build=true
gives me a suggestion of pizza, works wonderfully.
http://localhost/solr/spellCheckCompRH?spellcheck=true&q=pizzza&spellcheck.dictionary=external&spellcheck.build=true
gives me no suggestions. (Even with a more fleshed out dictionary
file, I haven't been able to get suggestions for any query I've tried
for the external dictionary.)
In both cases I can see the indexes getting rebuilt, and the size of
external index varies with the size of my spellings.txt, so I know
that the contents of spellings.txt is getting indexed (and peeking
into the segment files, I see the text entries). It is as if
everything is getting set up correctly but the actual index is coming
up empty at query time.
What happens when you open the built index in Luke (http://www.getopt.org/luke)?
--------------------------
Grant Ingersoll
http://www.lucidimagination.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ