[
https://issues.apache.org/jira/browse/SOLR-8499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15087479#comment-15087479
]
Shawn Heisey commented on SOLR-8499:
------------------------------------
bq. small tweaks to the existing implementation
Good idea. If I had known that there was a "numDeletedDocs()" I would have
used it. The same deleted calculation is used in LukeRequestHandler, I can
update that too. Creating the map with the proper initial size might make it
more efficient.
I put hasDeletions in because it's there in LukeRequestHandler and seemed like
a good idea. I suppose a check for "deletedDocs > 0" is just as effective as a
check for hasDeletions. Allocating less heap memory can be a good thing.
Now that I'm taking a second look, I am considering adding curly braces and
newlines to the "if" statement that is near the end of the additions to lst,
purely for readability. The code is perfectly valid as-is, but I find one-line
if clauses to be easier to visually parse if they are fully formatted.
> Add segmentCount and hasDeletions to SolrIndexSearcher stats
> ------------------------------------------------------------
>
> Key: SOLR-8499
> URL: https://issues.apache.org/jira/browse/SOLR-8499
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 5.4
> Reporter: Shawn Heisey
> Assignee: Shawn Heisey
> Priority: Minor
> Attachments: SOLR-8499.patch, SOLR-8499.patch
>
>
> I'd like to add a statistic to the /admin/mbeans (SolrInfoMBeanHandler)
> results -- the number of segments in the Lucene index. I think it would be
> best to add it to the stats returned by SolrIndexSearcher. Currently that
> info is available from /admin/luke (LukeRequestHandler), but I'm finding it
> very painful to add another client request to the code where I want to use
> this additional info.
> As long as I'm fiddling, hasDeletions would be another addition that some
> people might find useful.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]