lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trond Aksel Myklebust <trond...@stud.ntnu.no>
Subject Filtering of query based on field ID
Date Fri, 07 Oct 2005 21:41:15 GMT
As a new user of Lucene I wonder if anyone can suggest how to do this query
the fastest way:

 

In the index I got a "content" field with the data, and a "pathID" field
containing an ID ranging from 0 up to possible millions. 

In some cases I want to return the documents containing (for example) the
term "xml" for all documents, in other cases the ones with specific pathIDs.

 

My question is: What is the fastest way to retrieve documents containing (as
an example) the term "xml" with pathID between 0 and 100000 (with holes in
the range)?

As I know of, I could either:

 

1.	do a query: pathID:(1 2 3 5 6 ..) AND content:xml
2.	do a rangequery: pathID:({0 4} {4 7}) AND content:xml
3.	do the query: content:xml and in a loop filter out unwanted
documents by checking the pathID

 

Is there any other way, and what would be the best approach?

 

Regards

Trond Myklebust

University of Trondheim, Norway

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message