Thanks. I knew there had to be something like that. It worked perfectly.

----- Original Message ----
From: Yonik Seeley <[EMAIL PROTECTED]>
To: solr-user@lucene.apache.org
Sent: Wednesday, July 2, 2008 2:44:46 PM
Subject: Re: Fetching float or int fields from index by Lucene document

See the methods on FieldType, esp toExternal()

-Yonik

On Wed, Jul 2, 2008 at 5:39 PM, Kevin Osborn <[EMAIL PROTECTED]> wrote:
> As part of my results, I am building a lot of facet information. For example, 
> an Attribute ID also needs to return the Attribute Text.
>
> So, I have code like the following (really in a cache):
>
> Term term = new Term ("AtrID", "A0001");
> Document doc = searcher.doc(searcher.getFirstMatch(term));
>
> return doc.get("AtrText");
>
> This works great for string fields. But, if I am looking at a field that is 
> non-string in Document.get(), I get strange characters. I also notice if I 
> just print out doc.toString(). Most fields look fine, but int or float fields 
> are all messed up. I assume this is because the Lucene index really is just 
> text, so Solr must do some sort of encoding here.
>
> Is there anyway to decode the string into something readable?

Reply via email to