lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Haywood" <>
Subject RE: Leading wildcard in Lucene.Net 1.9?
Date Thu, 13 Jul 2006 14:15:34 GMT
I thought about using the reversed field approach, but I don't believe
that really works. Here's an example (our system is a product catalog
for industrial and manufacturing clients)...

User searches for: phillip driver
We assume he means: +*phillip* +*driver*
Item description contains: set of six phillips screwdrivers
Reversed description: srevirdwercs spillihp xis fo tes

Item *should* show as a hit

Boolean = +(Desc:phillip* RevDesc:pillihp*) +(Desc:driver*

Desc:phillip* = true
RevDesc:pillihp* = false
(Desc:phillip* RevDesc:pillihp*) = true

ForDesc:driver* = false
RevDesc:revird* = false
(Desc:driver* RevDesc:revird*) = false

+(Desc:phillip* RevDesc:pillihp*) +(Desc:driver* RevDesc:revird*) =

Item does not show in the hits collection

Has anyone gotten this to work correctly? Does anyone have any
RegExpQuery snippets they could send me?

-----Original Message-----
From: Nicolas [] 
Sent: Thursday, July 13, 2006 6:18 AM
Subject: Re: Leading wildcard in Lucene.Net 1.9?

As far as I know, PrefixQuery only allows trailing wildcards.
If you intend to do so the solution I've adopted is to index the term in
reverse order on another field.
if you mean to search  *def and you want to match abcdef  just create 2
fields regularField where you index a term in its natural order that is
to say abcdef reverseField where you index a term in the refverse order
that is to say fedcba then you'll have to transform the query
regularField:*def  in reverseField:fed*.
Concerning *abc*, maybe you can investigate RegExpQuery...

On 7/13/06, Nathan Haywood <> wrote:
> Our search instance needs to be able to search for a query as a 
> substring of a term... For example, hex (as *hex*). I looked on the 
> Lucene board and saw that there was a simple change to make to support

> this in the JAVA code, but the JAVA token syntax seems to have 
> vanished into a helper class in the port.
> Has anyone enables *abc* queries in their system? Any pointers, types,

> code snippets?
> Thank you,
> Nathan Haywood
> Senior Software Engineer
> CorMine, LLC

View raw message