lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Osborn <osbo...@yahoo.com>
Subject Fetching float or int fields from index by Lucene document
Date Wed, 02 Jul 2008 21:39:07 GMT
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