On 3/2/09 4:23 PM, "Ken Williams" <ken.willi...@thomsonreuters.com> wrote:
> On 3/2/09 1:58 PM, "Erik Hatcher" <e...@ehatchersolutions.com> 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.
Thanks,
--
Ken Williams
Research Scientist
The Thomson Reuters Corporation
Eagan, MN
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org