lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Chang <peter.c.e...@gmail.com>
Subject Re: Getting integer value from BytesRef
Date Mon, 07 Oct 2013 17:57:52 GMT
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, 장용석 <need4spd@gmail.com> wrote:

> Dear,
>
> I have indexing integer field like this
>
> -----
> Document doc = new Document();
> FieldType fieldType = 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 = null;
> while ((term = termsEnum.next()) != 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용식
> http://devyongsik.tistory.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message