You don't as far as I know. One solution that has been suggested is
to always index field2, but with a noop value. This works pretty well
if you choose a value you'd never search for, say xzxzxzxzxzxzxzx.
Then you can search field2 for that special value to get the *empty*
case.
Best
Erick
On 6/11/07, Dino <[EMAIL PROTECTED]> wrote:
Hi Everyone,
I have a lucene index were I add a document with a set of metadata. In my
system, all the fields in the metadata set needn't be there all the time
for
a given document.
Say if I am expecting a metadata set like
Field1:{yes|no}
[Field2:{val_1[,val_2]... }]
Field3:val_X
Here the Field2 is the one that I am having trouble with.
Currently when I get a document with a bunch of Field:Value metadata, I
run
them in a loop and create Field object relying on the metadata input. That
way the data source decides the number of fields attached to a particular
document. Fields like Field2 will be left out if it didn't appear in the
input.
So if I get a document like
Field1:yes
Field3:val_X
~~~~~~~~~~~~~~~~~~~
DATA DATA DATA DATA ..... DATA
The document in the index wouldn't have field2 attached to it.
Now my question is how will I search for all the documents with *empty*
Field2?
Cheerio
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]