lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: Fetching float or int fields from index by Lucene document
Date Wed, 02 Jul 2008 21:44:46 GMT
See the methods on FieldType, esp toExternal()


On Wed, Jul 2, 2008 at 5:39 PM, Kevin Osborn <> 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?

View raw message