lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Osborn <osbo...@yahoo.com>
Subject Re: Fetching float or int fields from index by Lucene document
Date Wed, 02 Jul 2008 22:44:31 GMT
Thanks. I knew there had to be something like that. It worked perfectly.


----- Original Message ----
From: Yonik Seeley <yonik@apache.org>
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 <osbornk@yahoo.com> 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?

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