lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Melissa Hao <m...@salesforce.com>
Subject For a two word wildcard query like name:john s* , can I avoid expanding s* for the entire name field?
Date Fri, 05 Feb 2010 01:15:08 GMT
Hi,

I am wondering about wildcard queries that are more than one word, such as:

    name:john s*

Note: All terms are required (default boolean operator is AND).

I know that for the query

    name:s*

The s* is expanded over all s* terms in the name field.

For the "john s*" case, is it possible to restrict documents to
documents that have "john", before expanding s*?  I know that's not how
Lucene normally works.  Lucene normally

1) Preprocesses the s* by replacing s* with (s OR sa OR sb OR sc ...).
2) Runs the query (john AND (s OR sa OR sb OR sc ...)).  For AND, Lucene
does the optimization where it figures which term is in the least number
of documents.  But the s* expansion already happened in step 1.

I'm curious because single-character wildcards are expensive for us, but
if we could somehow expand the wildcard only over the "john" documents,
that would help.

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