Thanks Hoss,
I hadn't looked at the indexDictionary method yet. It does not appear to
be what I am looking for though...I should have been more explicit -
I am using the spellchecker for a 'did you mean search', so I am not
using a dedicated spell check index. Instead I am passing the index that
I am searching and so I
do not want to add a dictionary to that index. The index must not be
modified...just have suggested words puled from it.
I want to be able to apply my 'did you mean' check across multiple
indexes in the case of a multisearcher being used.
- Mark
Chris Hostetter wrote:
: Does anyone have any interested in making the spellchecker work across more
: than one index? Does the coder of the spellchecker have any advice/dont do
: that moron info etc ?
Doesn't it already? ... the SpellChecker class doesn't seem to care if you
call indexDictionary more then once ... so you can make multiple
LuceneDictionary instances from your multiple indexes, and add all of
them...
SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
// To use terms from field a of index1
spellchecker.indexDictionary(new LuceneDictionary(reader1, a_field));
// To use terms from field b of index1
spellchecker.indexDictionary(new LuceneDictionary(reader1, b_field));
// To use terms from field c of index2
spellchecker.indexDictionary(new LuceneDictionary(reader2, c_field));
String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
...or am i missing something here?
(disclaimer: i've never acctually used SpellChecker, just skimmed the
code)
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]