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 A100AEB45 for ; Fri, 7 Dec 2012 16:34:59 +0000 (UTC) Received: (qmail 57609 invoked by uid 500); 7 Dec 2012 16:34:57 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 57037 invoked by uid 500); 7 Dec 2012 16:34:54 -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 57016 invoked by uid 99); 7 Dec 2012 16:34:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2012 16:34:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jpountz@gmail.com designates 209.85.210.174 as permitted sender) Received: from [209.85.210.174] (HELO mail-ia0-f174.google.com) (209.85.210.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2012 16:34:46 +0000 Received: by mail-ia0-f174.google.com with SMTP id y25so894472iay.33 for ; Fri, 07 Dec 2012 08:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=PFMMbu+E1AtoLxSABT7fDuGbYVmDPOK1ww9siy8qzI8=; b=CDw37/78kqNezceU+YFiJp4y2w1zqXSADhHp0HPAP42oyuFRJ8XbmUoUdF5GvSM0X3 q5fHlu2Gp2e4lhq7d30Z9ww/UVEgXwFOhY8x+W9MkF4UhxIQdThtrXJXWOnyqJKCSJug kwOcZzCzR80WzsgZ6FIBRTP5zOG9GnzsAybrocOZLBYxTcjxd7Vt18JT0y/eIHb9v35L XtOV0XdVsDNTI7kxBOlSpe9VqyqEq0aJE2tlHblcbiDJtDr05LSHKeB5i3NBBIjx4AnL 0eLNZ8VxRaN0TuzS6x+1K4E77ETsHdjiZJykbj5Pxg2joXUvZHFSo0ssTnv66n32+gKB bheA== Received: by 10.50.13.162 with SMTP id i2mr5519882igc.38.1354898063295; Fri, 07 Dec 2012 08:34:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.52.138 with HTTP; Fri, 7 Dec 2012 08:34:03 -0800 (PST) In-Reply-To: <7B17ABD38A7A234E8C7D4462A26A489B0861281B@MIVEXEMEA1N1.corp.nai.org> References: <7B17ABD38A7A234E8C7D4462A26A489B08612460@MIVEXEMEA1N1.corp.nai.org> <7B17ABD38A7A234E8C7D4462A26A489B0861281B@MIVEXEMEA1N1.corp.nai.org> From: Adrien Grand Date: Fri, 7 Dec 2012 17:34:03 +0100 Message-ID: Subject: Re: Lucene 4.0.0 - find term position. To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=f46d044469efc5055b04d045c94d X-Virus-Checked: Checked by ClamAV on apache.org --f46d044469efc5055b04d045c94d Content-Type: text/plain; charset=UTF-8 Hi Vitaly, On Fri, Dec 7, 2012 at 3:24 PM, wrote: > I try to use or Terms tfvector = reader.getTermVector(docId, "contents"); > or Fields fields = reader.getTermVectors(docId); > but I get null from these calls. > What is wrong? These methods will always return null unless you turn term vectors on at indexing time (see FieldType.setStoreTermVectors[1] and FieldType.setStoreTermVectorPositions[2]). [1] http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/document/FieldType.html#setStoreTermVectors(boolean) [2] http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/document/FieldType.html#setStoreTermVectorPositions(boolean) -- Adrien --f46d044469efc5055b04d045c94d--