Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 05F2C64DF for ; Thu, 9 Jun 2011 09:08:15 +0000 (UTC) Received: (qmail 74084 invoked by uid 500); 9 Jun 2011 09:08:12 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 74047 invoked by uid 500); 9 Jun 2011 09:08:12 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 74039 invoked by uid 99); 9 Jun 2011 09:08:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 09:08:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ian.lea@gmail.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-iy0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 09:08:05 +0000 Received: by iym1 with SMTP id 1so1756024iym.35 for ; Thu, 09 Jun 2011 02:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=R3+AgVG850rthd9pEn8on18hxesmeubU8dcDFIiFqTU=; b=Cqmo9JWNpLjtpdSqJBYmXBGjo4pzlq6SGUf/2UPKn6vphMbRAXkEopB4rt5YmYPIv4 b9ThW75+asMnPGOJtfrwBDTFABIT/D8XQmOLdUHw+LTFY5+q/cPI6IULSkKS7wXw9RwX HyJeHWv8JVxa60BLBjQhHl3lyP6fbicgiGLmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=yAwF2PiJaHbEFAc2DNsKD5Y7qxaSoxhMIneVfQaeE9n01LLR5PFcrWwJdo+nWBbbxh +iJ6q9W/Xu2c90CvusDyvYJfJSYYCYTzCwUgPEqq7PJTaXW+I6J9JPfoqatcrM1tipLr iBL41G0pNodpIuYCQGPHrGN4NMutJIYd79hGQ= Received: by 10.231.116.132 with SMTP id m4mr587944ibq.86.1307610464077; Thu, 09 Jun 2011 02:07:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.199.148 with HTTP; Thu, 9 Jun 2011 02:07:24 -0700 (PDT) In-Reply-To: References: From: Ian Lea Date: Thu, 9 Jun 2011 10:07:24 +0100 Message-ID: Subject: Re: Get all the field names To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org See the javadocs for IndexReader.getFieldNames(IndexReader.FieldOption fldOption). Also see the javadocs for your "Why isn't this correct?" question. Reading Lucene In Action is highly recommended for all people new to lucene. -- Ian. On Thu, Jun 9, 2011 at 9:03 AM, Pranav goyal wrote: > Hi, > > I want to retrieve all the field names from my index so that I can store > them in an array to use in MutiFieldQueryParser. > One question can I do it using my index directory? If yes then a piece of > code would be really helpful as I searched out a lot but no documentation is > there on this thing. > > Why I want to do it using index directory is because my indexing code and > searching codes are in a different file. So it would be better if I can > access field names using the directory. > > I tried with > > IndexReader ir = new IndexReader(FSDirectory.open(indexDir)); > > Why isn't this correct? > > I am a newbie in lucene, so may be these doubts can be silly. > > Thanks > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org