Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 85725 invoked from network); 25 May 2004 01:12:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 May 2004 01:12:14 -0000 Received: (qmail 18279 invoked by uid 500); 25 May 2004 01:12:35 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 18218 invoked by uid 500); 25 May 2004 01:12:34 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 18190 invoked by uid 98); 25 May 2004 01:12:34 -0000 Received: from sits@nuix.com.au by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(210.50.55.251):. Processed in 0.133208 secs); 25 May 2004 01:12:34 -0000 X-Qmail-Scanner-Mail-From: sits@nuix.com.au via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(210.50.55.251):. Processed in 0.133208 secs) Received: from unknown (HELO file1.syd.nuix.com.au) (210.50.55.251) by hermes.apache.org with SMTP; 25 May 2004 01:12:34 -0000 Received: from host55.syd.nuix.com.au (host55.syd.nuix.com.au [192.168.222.55]) by file1.syd.nuix.com.au (Postfix) with ESMTP id A9BD6B6FE7 for ; Tue, 25 May 2004 11:11:55 +1000 (EST) Content-Type: text/plain; charset="us-ascii" From: David Sitsky To: lucene-user@jakarta.apache.org Subject: Query for the existence of a Lucene field in a document? Date: Tue, 25 May 2004 11:05:45 +1000 User-Agent: KMail/1.4.3 Organization: Nuix Pty Ltd. MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200405251105.45262.sits@nuix.com.au> X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I have an application using Lucene 1.3 final. In this application, I am loading data where the main text for each document is stored into a "body" field, a couple of other internal fields, and basically some "meta-data fields" driven by the data being loaded, which can created Lucene fields like M1, M2, M3, ... Not every document has every meta-data field present, for example, one document may have M1, M5, M6, another might just have M1, M2, M3. It is also possible for the meta-data field value to be just the empty string. The presence of a meta-data field has meaning to the application. In general, it is not known in advance what meta-data fields are present, but it is generally a smallish number (< 100). There is a requirement for the user to be able to retrieve all documents which have a particular meta-data field present. I can't see anyway of doing this with the query parser. Is there a way of doing this? ie, retrieve all documents which have a specific field set. I seems to me I need to create a new tokenized unstored field called something like "meta-data-fields" for each document, which contains what meta-data field names are present for that document. In the above example, one document could have the value "M1 M5 M6", the other "M1 M2 M3". Does this seem reasonable? Is there any way of doing this without introducing a new field? -- Cheers, David This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org