lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: Searching for Partial Words
Date Tue, 06 Nov 2012 14:00:20 GMT
Add an "edge" n-gram filter (EdgeNGramFilterFactory) to your "index" 
analyzer. This will add all the prefixes of words to the index, so that a 
query of "engi" will be equivalent to but much faster than the wildcard 
engi*. You can specify a minimum size, such as 3 or 4 to eliminate tons of 
too-short prefixes, if you want.

See:
http://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramFilterFactory.html
http://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html

-- Jack Krupansky

-----Original Message----- 
From: Sohail Aboobaker
Sent: Tuesday, November 06, 2012 8:08 AM
To: solr-user@lucene.apache.org
Subject: Searching for Partial Words

Hi,

Given following values in the document:

Doc1: Engine
Doc2. Engineer
Doc3. ResidentEngineer

We need to return all three documents when someone searches for "engi".

Basically we need to implement partial word search. Currently, we have a
wild card on the right side of search term (term*). Is it possible to have
wild card on both sides of a search term?

Regards,
Sohail Aboobaker. 


Mime
View raw message