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

Tim Smith commented on LUCENE-1923:
-----------------------------------

I'll work up a patch that will do the following:

add getName() method to IndexReader (and all subclasses (SegmentReader, 
DirectoryReader, MultiReader, any others i'm not currently aware of that i 
track down)

have toString() return "indexreaderclassname(getName())"

so, toString for a SegmentReader will look something like:
"org.apache.lucene.index.SegmentReader(_ae)"

for a DirectoryReader, it'll look like:
"org.apache.lucene.index.DirectoryReader(segments_7)"



> Add toString() or getName() method to IndexReader
> -------------------------------------------------
>
>                 Key: LUCENE-1923
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1923
>             Project: Lucene - Java
>          Issue Type: Wish
>          Components: Index
>            Reporter: Tim Smith
>
> It would be very useful for debugging if IndexReader either had a getName() 
> method, or a toString() implementation that would get a string identification 
> for the reader.
> for SegmentReader, this would return the same as getSegmentName()
> for Directory readers, this would return the "generation id"?
> for MultiReader, this could return something like "multi(sub reader name, sub 
> reader name, sub reader name, ...)
> right now, i have to check instanceof for SegmentReader, then call 
> getSegmentName(), and for all other IndexReader types, i would have to do 
> something like get the IndexCommit and get the generation off it (and this 
> may throw UnsupportedOperationException, at which point i have would have to 
> recursively walk sub readers and try again)
> I could work up a patch if others like this idea

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to