AFAIK there is no strait way of doing that, however you can create another field (field4) which can indicate if field2 exists.
HTH Aviran http://www.aviransplace.com http://shaveh.co.il -----Original Message----- From: Dino [mailto:[EMAIL PROTECTED] Sent: Monday, June 11, 2007 9:54 AM To: java-user@lucene.apache.org Subject: searching for empty field 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]