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 7C5A9E6DC for ; Fri, 4 Jan 2013 14:03:08 +0000 (UTC) Received: (qmail 82173 invoked by uid 500); 4 Jan 2013 14:03:06 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 82134 invoked by uid 500); 4 Jan 2013 14:03:06 -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 82118 invoked by uid 99); 4 Jan 2013 14:03:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2013 14:03:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.52] (HELO mail-pb0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2013 14:03:01 +0000 Received: by mail-pb0-f52.google.com with SMTP id ro2so9139522pbb.11 for ; Fri, 04 Jan 2013 06:02:40 -0800 (PST) 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:content-transfer-encoding:x-gm-message-state; bh=NB+XA/9OsXecRIJ79Q9dUUpUtjAmDlMRbvO4ydg8tTY=; b=aRzIyFZYrWeOP/Yy32QsbWfHYwcqlzPAw6WJcmkFkejm5Ja6ZlPemOz/H4n/qO8Kch 7ILMv3rs6Ve6KQiYXqJkjwq7XUacfc23tRKSA9+VsXfRHKvFt1buP+Snn95NevCJmpp9 23DIVMCt8Mc+opQwJHbrUdvEPT/mGKSqPAILCL/7Vr6lqc2sVAxD/SHW2L68BZ9RO5jZ jBUqZw+c+j67xaJ4Zt882FdC/TSgpqc/HKJKl+zNqrUhegmAdXUadR1UazGc3N+vtIqS PB1n/xdBBQ4AUHF0/azF8OS+2m8xjaR4KWnqo43amQYc0D6wdXEj9yQMUrpYAeL8IFf8 obSA== Received: by 10.68.209.230 with SMTP id mp6mr161315252pbc.8.1357308160393; Fri, 04 Jan 2013 06:02:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.34.106 with HTTP; Fri, 4 Jan 2013 06:02:20 -0800 (PST) In-Reply-To: References: From: Michael McCandless Date: Fri, 4 Jan 2013 09:02:20 -0500 Message-ID: Subject: Re: Terms.getSumTotalTermFreq() in Lucene 4.0 To: java-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlAni0uAZ83VEcxnGbyW2qmvtvjfVTYICaNQ6HfBX0/oN/Qy0eZU6jOps+2m2Rbeh0xLKXI X-Virus-Checked: Checked by ClamAV on apache.org The problem is that the TermVectorsFormat for the default codec (Lucene40TermVectorsFormat) does not store this statistic per-document, currently. We could in theory fix this ... maybe open an issue / make a patch if it's important? -1 return value is actually "valid": it means this statistic is not availab= le. Mike McCandless http://blog.mikemccandless.com On Fri, Jan 4, 2013 at 2:39 AM, =EC=9E=A5=EC=9A=A9=EC=84=9D wrote: > Hello. > I have some questions. > > Document 1 : "learning perl learning java learning ruby" > Document 2 : "perl test" > > I have indexed this documents, with StoreTermVectors(true) and > IndexOptions.DOCS_AND_FREQS. > Field name is "f". > > And I executed this code. > > IndexReader ir =3D IndexReader.open(dir); > Terms terms =3D ir.getTermVector(0, "f"); > > System.out.println(terms.getDocCount()); -> 1 > System.out.println(terms.getSumDocFreq()); -> 4 > System.out.println(terms.getSumTotalTermFreq()); -> -1 > > I think this terms instance acts like a single-document inverted index. > > So getDocCount is 1 (single document), and getSumDocFreq is 4. (because > each term's docFreq is 1) > Is this right? > > But I can't understand why getSumTotalTermFreq method return -1. > In javadoc getSumTotalTermFreq is sum of > TermsEnum.totalTermFreq > . > > I think in Document1, each term's totalTermFreqs are [learning, 3], [java= , > 1], [perl, 1], [ruby, 1]. > So getSumTotalTermFreq method's result is 6 not -1. > > Why temrs.getSumTotalTermFreq() method return -1? > > > Thanks in advance. > -- > DEV=EC=9A=A9=EC=8B=9D > http://devyongsik.tistory.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org