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 6AE64C465 for ; Tue, 16 Jul 2013 15:01:04 +0000 (UTC) Received: (qmail 20151 invoked by uid 500); 16 Jul 2013 15:01:02 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 19975 invoked by uid 500); 16 Jul 2013 15:01:01 -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 19910 invoked by uid 99); 16 Jul 2013 15:00:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 15:00:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.212.50] (HELO mail-vb0-f50.google.com) (209.85.212.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 15:00:55 +0000 Received: by mail-vb0-f50.google.com with SMTP id w16so527032vbb.23 for ; Tue, 16 Jul 2013 08:00:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=Zut4+rh0dl641kDaqQep7iBfAmf3Ef7i5ma7ha8JSXg=; b=SKrL1hZnRVVvzuHctt1hqnNUeeeSZbQ9IrLCJVHWzUfTnmEZR2L9OilOFXvtP1pW28 G0Vq1nvqIbB71/Xg5B5rFAG9Z928UgNrX1Ulx9/dUlae0tEaLcPjNORh648gAtweaExo KVAV/0xUwOfq2Rpi0SxeHwRLY8XKkokcdRM0QtYxuGNuh0jdE27Cq9EPZmvmcahLFFzw RDEc+wo6Jbbrsr4IO4S0F+e+BiHd69PVLyavZeED7j6zBFHPSXBy7/TaUHzwF2zXzrlp h4maxfJ22Wjzi27ODtbD0AnPd5BEnro7eqhfNaQLDVUViD+UGIoYZE1bDmhbqlaiiEk1 880A== X-Received: by 10.58.46.196 with SMTP id x4mr544917vem.73.1373986813468; Tue, 16 Jul 2013 08:00:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.55.136 with HTTP; Tue, 16 Jul 2013 07:59:53 -0700 (PDT) In-Reply-To: References: From: Michael McCandless Date: Tue, 16 Jul 2013 10:59:53 -0400 Message-ID: Subject: Re: MultiFields.getReader() returns null To: Lucene Users Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkU6G4CkW7KIVb6NDCmPV/Z2cXWGyac8d67GPFjMCn2oiuWBgTP7axZkm3/vXSgwIPc7ypz X-Virus-Checked: Checked by ClamAV on apache.org I'm confused about the problem: exactly which method call is returning null? What do yo umean by "it is coming in the contents of MultiReader"? Maybe post a full working test showing the problem? Your indexing code looks correct, except if you are using only PostingsHighlighter you don't need to index term vectors. Also, since you are starting from TextField.TYPE_STORED, you should only need to call offsetsType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) ... all the other settings (except term vectors) are inherited from TextField.TYPE_STORED. Mike McCandless http://blog.mikemccandless.com On Tue, Jul 16, 2013 at 9:56 AM, VIGNESH S wrote: > Hi Mike, > > If i use StringField.Type_STORED instead of TextField.Type_Stored it is > coming in the contents of MultiReader.. > > > > On Tue, Jul 16, 2013 at 7:16 PM, VIGNESH S wrote: > >> Hi Mike, >> >> Thanks for your Reply. >> >> Contents are Getting Indexed..In MultiReader the other two fields are >> coming except the field(ContentIndex.KEY_TEXTCONTENT) which i indexed >> like below >> >> FieldType offsetsType = new FieldType(TextField.TYPE_STORED); >> offsetsType.setIndexed(true); >> offsetsType.setStored(true); >> offsetsType.setStoreTermVectors(true); >> offsetsType.setTokenized(true); >> offsetsType.setStoreTermVectorOffsets(true); >> >> offsetsType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS); >> Document doc = new Document(); >> Field body = new Field(ContentIndex.KEY_TEXTCONTENT, "", offsetsType); >> body.setStringValue(content); >> >> Any problem with the above indexing methodology..Basically I am Indexing >> like this for implementing Postings Highlighter.. >> >> Please kindly help.. >> >> >> On Tue, Jul 16, 2013 at 5:06 PM, Michael McCandless < >> lucene@mikemccandless.com> wrote: >> >>> MultiFields.getFields returns null if the reader has no postings. Are >>> you sure you actually indexed any content? >>> >>> Mike McCandless >>> >>> http://blog.mikemccandless.com >>> >>> >>> On Tue, Jul 16, 2013 at 3:06 AM, VIGNESH S >>> wrote: >>> > Hi, >>> > >>> > I am creating index like this in\\using Lucene 4.3.1 >>> > >>> > I am using 3 fields like >>> > >>> > FieldType offsetsType = new FieldType(TextField.TYPE_STORED); >>> > offsetsType.setIndexed(true); >>> > offsetsType.setStored(true); >>> > offsetsType.setStoreTermVectors(true); >>> > offsetsType.setTokenized(true); >>> > offsetsType.setStoreTermVectorOffsets(true); >>> > >>> offsetsType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS); >>> > Document doc = new Document(); >>> > Field body = new Field(ContentIndex.KEY_TEXTCONTENT, "", offsetsType); >>> > body.setStringValue(content); >>> > >>> > >>> > In Search, I am using code like this >>> > >>> > Fields fields = MultiFields.getFields(mReader); >>> > >>> > It returns null in Fields..What can be the problem >>> > >>> > >>> > >>> > >>> > >>> > -- >>> > Thanks and Regards >>> > Vignesh Srinivasan >>> > 9739135640 >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >>> For additional commands, e-mail: java-user-help@lucene.apache.org >>> >>> >> >> >> -- >> Thanks and Regards >> Vignesh Srinivasan >> 9739135640 >> > > > > -- > Thanks and Regards > Vignesh Srinivasan > 9739135640 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org