lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <daniel.na...@t-online.de>
Subject Re: Matching a single document
Date Mon, 09 Feb 2004 19:00:38 GMT
On Sunday 08 February 2004 20:07, Chris Kimm wrote:

>  Two possible
> approaches, both of which seem ungainly, are 1) creating a temporary
> index for each document being indexed 

You can use a RAMDirectory for indexing so nothing needs to be written to 
disk. This should be quite fast.

> or 2) Writing a class that matches 
> document Fields with Query Terms.  This second approach would require a
> way to extract individual Terms from Queries.  Is that possible?

Yes, you need to recursively iterate over all parts of the query. For 
example, a boolean query may consist of other boolean queries. You need to 
go down until you've got a TermQuery, which holds the term itself (or you 
could use rewrite() to make this easier).

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message