lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <lucenel...@danielnaber.de>
Subject Re: wildcards within a phrase query
Date Wed, 12 Oct 2005 20:59:35 GMT
On Mittwoch 12 Oktober 2005 17:18, Robert Watkins wrote:

> Does that sound reasonable -- and scalable -- to you?

I don't think you need to iterate at all, you can easily expand the terms 
of a query:

    QueryParser qp = new QueryParser("f", new StandardAnalyzer());
    Query q = qp.parse("e*");
    IndexReader ir = IndexReader.open("/tmp/index");
    System.out.println(q.rewrite(ir));

This will expand e* to all of your indice's words that start with "e". Same 
for wildcard queries.

I'll leave the guessing about performance to others. Why not just give it a 
try when it's so easy?

Regards
 Daniel

-- 
http://www.danielnaber.de

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