lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Melissa Hao <>
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

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


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:
For additional commands, e-mail:

View raw message