You might use the Lucene internal CheckIndex included in lucene core.
It should tell you everything you need. At least a good starting
point for writing your own tool.
Copy lucene-core-x.y.z-SNAPSHOT.jar and lucene-misc-x.y.z-SNAPSHOT.jar
to a local directory.
java -cp lucene-core-x.y.z-SNAPSHOT.jar -ea:org.apache.lucene...
org.apache.lucene.index.CheckIndex /path/to/your/index
If you append a "-verbose" you will get tons of info about your index.
Regards
Bernd
Am 26.08.19 um 22:19 schrieb Bram Van Dam:
Possibly somewhat unusual question: I'm looking for a way to query the
number of *lucene documents* from within Solr. This can be different
from the number of Solr documents (because of unmerged deletes/updates/
etc).
As a bit of background; we recently found this lovely little error
message in a Solr log, and we'd like to get a bit of an early warning
system going :-)
Too many documents, composite IndexReaders cannot exceed 2147483647
If no way currently exists, I'm not adverse to hacking one in, but I
could use a few pointers in the general direction.
As an alternative strategy, I guess I could use Lucene to walk through
each index segment and add the segment info maxDoc values. But I'm not
sure if that would be a good idea.
Thanks a bunch,
- Bram