lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Biggy <>
Subject Re: Searching by bit masks
Date Mon, 27 Nov 2006 17:37:47 GMT

i have the same problem here. I have an interest bit field, which i 
receive from the applciation backend. I have control over how the docuemtns
are built.
To be specific, the field looks like this:

ID: interest
1 : sport
2 : music
4 : film
8 : clubs

So someone interested in sports and music can be found by "interest & 3" =>
e.g. when using SQL.

I do not wish to Post-Filter the results
On to Lucene, Is there a filter which supports this kind of query ?

Someone suggested splitting the bits into fields:
> Document doc = new Document();
> doc.add("flag1", "Y");
> doc.add("flag2", "Y");
> IndexWriter.add(doc); 
Is this helpful at all ?

Code would be helpful too as i am a newbie

ltaylor.employon wrote:
> Hello, 
> I am currently evaluating Lucene to see if it would be appropriate to
> replace my company's current search software. So far everything has been
> looking great, however there is one requirement that I am not too
> certain about. 
> What we need to do is to be able to store a bit mask specifying various
> filter flags for a document in the index and then search this field by
> specifying another bit mask with desired filters, returning documents
> that have any of the specified flags set. In other words, we are doing a
> bitwise OR on the stored filter bit mask and the specified filter bit
> mask and if it is non-zero, we want to return the document. 
> Before I started toying around with various options myself, I wanted to
> see if any of you good folks in the Lucene community had some
> suggestions for an efficient way to implement this. 
> We currently need to index ~8,000,000 documents. We have several filter
> flag fields, the most important of which currently has 7 possible flags
> with any combination of the flags being valid. The number of flags is
> expected to increase rather rapidly in the near future. 
> My preemptive thanks for your suggestions,
> Lawrence Taylor
> Senior Software Engineer
> Employon
> Message was edited by: ltaylor.employon

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message