[ 
https://issues.apache.org/jira/browse/LUCENE-7361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15356285#comment-15356285
 ] 

David Smiley commented on LUCENE-7361:
--------------------------------------

Lets just remove toString() from MemoryIndex; I think it could be dangerously 
large and I've certainly put a ton of data in MemoryIndex before.  But this 
issue isn't about MemoryIndex.toString(), it's about a hypothetical 
Terms.toStringDebug(Appendable) that wouldn't be called by Lucene itself (thus 
won't be in InfoStream), just a user if they want to (likely in a debug session 
passing System.out).

bq. Having some kind of introspector on an index could be useful, though, so 
maybe instead of adding .toString() implementations, we have a special class in 
misc/ that prints this information out? And then MemoryIndex.toString() can 
just include some top-level stats, and users get pointed to the introspector 
for more detailed debugging info.

+1 This issue can be retitled to reflect this change in location of the code.  
What do you think of the name IndexPrettyPrinter?  Does this strategy sound 
good [~rcmuir]?  I would prefer a Terms.toStringDebug though a utility class in 
misc/ is almost as good to me.

> Terms.toStringDebug
> -------------------
>
>                 Key: LUCENE-7361
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7361
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: David Smiley
>         Attachments: MemoryIndexToString.java
>
>
> While fixing LUCENE-7340, MemoryIndex.toString(), I thought MemoryIndex 
> shouldn't need it's own debug toString() impl for its Terms when there could 
> be a generic one.  So here I propose that we create a 
> Terms.toStringDebug(Appendable result, int charLimit, String indent) or 
> some-such but probably not override toString() for obvious reasons.  Maybe 
> also have this on Fields() that simply loops and calls out to the one on 
> Terms.
> The format is debatable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to