lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vanlerberghe, Luc" <Luc.Vanlerber...@bvdep.com>
Subject RE: Small problem in searching
Date Fri, 16 Sep 2005 12:08:11 GMT
You could also add a field with all the terms reversed during the
indexation.

So documents containing "tirupathireddy" or "venkatreddy" would have
"ydderihtapurit" and "yddertaknev" in the reversed field.
If you detect that the user entered a suffix query like "*reddy",
transform it into a prefix query like "ydder*" on the reversed field.

Luc


-----Original Message-----
From: jian chen [mailto:chenjian1227@gmail.com] 
Sent: donderdag 15 september 2005 18:22
To: java-user@lucene.apache.org
Subject: Re: Small problem in searching

Hi,

I think Lucene transforms the prefix match query into all sub queries
where 
the searching for a prefix could result into search for all terms that
begin 
with that prefix.

For "postfix" match, I think you need to do more work than relying on 
Lucene's query parser. 

You can iterate over the terms and do an "endsWith()" call, and if there
is 
a match, then, perform a normal Lucene search for that term. 

So, effectively, you do the same thing as prefix match, conceptually
loop 
over all available terms in your dictionary and find all the terms to be

prepared for actual searching.

This might be slow. What you might want to speed up the performance is,
you 
can store all the available terms in-memory, and looping through all
unique 
terms is a breeze. This is what google used for their prototype search 
engine when they were way back in the 1998s. (I guess :-)

Cheers,

Jian

On 9/15/05, tirupathi reddy <tirupathireddy_m@yahoo.com> wrote:
> 
> Hi guys,
> 
> I have some problem while searching using Lucene. Say I have some
thing 
> like "tirupathireddy" or "venkatreddy" in the index. When i search for

> string "reddy" I have to get those things (i.e. "tirupathireddy" and 
> "venkatreddy"). I have read in Query syntax of Lucene that * will not
be 
> given at the starting of the search string. SO how can I achiev that.
I am 
> in very much need of that. So please help me out.
> 
> 
> WIth Regards,
> TirupatiReddy Manyam.
> 
> 
> Tirupati Reddy Manyam
> 24-06-08,
> Sundugaullee-24,
> 79110 Freiburg
> GERMANY.
> 
> Phone: 00497618811257
> cell : 004917624649007
> 
> 
> ---------------------------------
> Yahoo! for Good
> Click here to donate to the Hurricane Katrina relief effort.
>


---------------------------------------------------------------------
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