lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyer, James" <>
Subject RE: Spellcheck help
Date Fri, 23 Jul 2010 18:12:04 GMT
In org.apache.solr.spelling.SpellingQueryConverter, find the line (#84):

final static String PATTERN = "(?:(?!(" + NMTOKEN + ":|\\d+)))[\\p{L}_\\-0-9]+";

and remove the |\\d+ to make it:

final static String PATTERN = "(?:(?!" + NMTOKEN + ":))[\\p{L}_\\-0-9]+";

My testing shows this solves your problem.  The caution is to test it against all your use
cases because obviously someone thought we should ignore leading digits from keywords.  Surely
there's a reason why although I can't think of it.

James Dyer
E-Commerce Systems
Ingram Book Company
(615) 213-4311

-----Original Message-----
From: [] 
Sent: Saturday, July 17, 2010 12:41 PM
Subject: Re: Spellcheck help

Can anybody help me with this? :(

-----Original Message----- 
From: Marc Ghorayeb
Sent: Thursday, July 08, 2010 9:46 AM
Subject: Spellcheck help

Hello,I've been trying to get rid of a bug when using the spellcheck but so 
far with no success :(When searching for a word that starts with a number, 
for example "3dsmax", i get the results that i want, BUT the spellcheck says 
it is not correctly spelled AND the collation gives me "33dsmax". Further 
investigation shows that the spellcheck is actually only checking "dsmax" 
which it considers does not exist and gives me "3dsmax" for better results, 
but since i have spellcheck.collate = true, the collation that i show is 
"33dsmax" with the first 3 being the one discarded by the spellchecker... 
Otherwise, the spellcheck works correctly for normal words... any ideas? 
:(My spellcheck field is fairly classic, whitespace tokenizer, with 
lowercase filter...Any help would be greatly appreciated :)Thanks,Marc
Messenger arrive enfin sur iPhone ! Venez le télécharger gratuitement ! 

View raw message