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 F3377109E8 for ; Mon, 7 Oct 2013 17:58:25 +0000 (UTC) Received: (qmail 28302 invoked by uid 500); 7 Oct 2013 17:58:23 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 27882 invoked by uid 500); 7 Oct 2013 17:58:20 -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 27874 invoked by uid 99); 7 Oct 2013 17:58:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Oct 2013 17:58:18 +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 (nike.apache.org: domain of peter.c.eric@gmail.com designates 74.125.83.49 as permitted sender) Received: from [74.125.83.49] (HELO mail-ee0-f49.google.com) (74.125.83.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Oct 2013 17:58:12 +0000 Received: by mail-ee0-f49.google.com with SMTP id d41so3357158eek.8 for ; Mon, 07 Oct 2013 10:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=G44C4lUaB0q94cyU3wYGRXfLk0yTCFme39Msn7jh5Og=; b=pJJX8vFw3MQ2c6laIhzkiXb2SyKmff4HYYr92m41td0k2mbU7EbNCbp6guaw3WfVns H5H/qlKLUdZSS6ZiDbwXDVkNNUioakeCYe+9ICLoOoHhKkVhgD/pg3+m+52mMv+M+eUK YtFt2M/z5fOgAPWJGHJHtGqvSTV9Z+Ya56GwJE0cDgVUJzovoB0jstbkDqqWIuUA9PHD KdxwzYe4jfEKjA2K8Pn7R1XKQ5Jt70+IThGw1CxZ6cHGpLfoUnoR+0drDvGFUwCXz0p0 ubewWheVlAbTGEogCzRyMZRnez5hKUpojpYEjXiiTMYwdVNv8EuD3XH3uv4FSI443Kp5 vIrA== MIME-Version: 1.0 X-Received: by 10.15.99.72 with SMTP id bk48mr51406476eeb.22.1381168672740; Mon, 07 Oct 2013 10:57:52 -0700 (PDT) Received: by 10.223.168.7 with HTTP; Mon, 7 Oct 2013 10:57:52 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Oct 2013 01:57:52 +0800 Message-ID: Subject: Re: Getting integer value from BytesRef From: Peter Chang To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=089e016816161d3a1704e82a64f6 X-Virus-Checked: Checked by ClamAV on apache.org --089e016816161d3a1704e82a64f6 Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: quoted-printable Your doc freq is always 1. It's useless. I don't know why you try to index and search a binary field except for range searching. On Mon, Oct 7, 2013 at 11:23 PM, =C0=E5=BF=EB=BC=AE wr= ote: > Dear, > > I have indexing integer field like this > > ----- > Document doc =3D new Document(); > FieldType fieldType =3D new FieldType(); > fieldType.setIndexed(true); > fieldType.setStored(true); > fieldType.setTokenized(false); > fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS); > fieldType.setStoreTermVectors(true); > fieldType.setNumericType(NumericType.INT); > doc.add(new IntField("contents", 1, fieldType)); > ----- > > and I have tried to get integer value and doc frequency like this > > ----- > ... > > BytesRef term =3D null; > while ((term =3D termsEnum.next()) !=3D null) { > System.out.println("doc Freq of ["+term.utf8ToString()+"] : " + > termsEnum.docFreq()); > ----- > > But term.utf8toString is return some broken character like this [d@], [l = ] > ..etc. > > How can I get right value from BytesRef? > > Thanks and Regards. > -- > DEV=BF=EB=BD=C4 > http://devyongsik.tistory.com > --089e016816161d3a1704e82a64f6--