lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Maes" <jm...@materialogic.com>
Subject Problem using SpellChecker with run time strings
Date Tue, 23 May 2006 15:50:06 GMT

Here is the problem:

We have implemented the lucene eninge within our application server which is
built ontop of Tomcat.  We've had no problems creating the indexes or
searching them.  The problems we are having are all related to the
SpellChecker part of the system.

It seems to be related to Strings and when they are created.  When all
strings (fields to index, word to search, etc..) are known at compile time,
every thing works great.  When things are defined at run time (ie, user
input, config files, etc..) things break. 

An simple example.  (word is read in from a user and then passed to this
method and is set to "post card")

String[]suggestions = null;

// Using user defined runtime string //
suggestions = speller.suggestSimilar(word, 5);
System.out.println("suggestions ["+ suggestions.length +"]");


// Using hard coded compile time string //
suggestions = speller.suggestSimilar("post card", 5);
System.out.println("suggestions ["+ suggestions.length +"]");


Results:
     [java] suggestions [0] 
     [java] suggestions [3] 

We've tried this 10 diffent ways, and keep on getting the same results. 

>From a little bit of searching that I did, it looks like Lucence is using ==
instead of .equals() for some internal stuff.  Is that related to my issues
and if so, any good ideas on what I need to do to avoid it?


Just in case, here is some related system information:

System Information:
       OS: Linux (Suse 9.2)
       Java SDK Version: 1.5.6
       Lucene Version: 1.9.1
       Installed Jars: 
		lucene-core-1.9.1.jar  
		lucene-snowball-1.9.1.jar  
		lucene-spellchecker-1.9.1.jar



Thanks
-JM

James Maes
Software Architect
Materialogic
PH: 800-333-7144
PH: 314-997-4342 Ext. 3422
FX: 314-997-7814



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message