lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Williams <>
Subject Re: Confidence scores at search time
Date Mon, 02 Mar 2009 22:42:20 GMT

On 3/2/09 4:23 PM, "Ken Williams" <> wrote:

> On 3/2/09 1:58 PM, "Erik Hatcher" <> wrote:
>> On Mar 2, 2009, at 2:47 PM, Ken Williams wrote:
>>> In the output, I get explanations like "0.88922405 = (MATCH) product
>>> of:"
>>> with no details.  Perhaps I need to do something different in
>>> indexing?
>> Explanation.toString() only returns the first line.  You can use
>> toString(int depth) or loop over all the getDetails().   toHtml()
>> returns a decently formatted tree of <ul>'s of the whole explanation
>> also.
> It looks like toString(int) is a protected method, and toHtml() only seems
> to return a single <ul> with no content.  I can start writing a recursive
> routine to dive down into getDetails(), but I thought there must be
> something easier.

Okay, silly me - notice that in my code I was printing the string with
println().  I didn't realize println() truncated strings that contain
newline characters (nor was I aware that the string had any newlines, I
guess!).  Once I ran it through replaceAll( "\n", "\\\\n" ) I'm getting the
output I need.


Ken Williams
Research Scientist
The Thomson Reuters Corporation
Eagan, MN

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message