Skip to content

Unique terms not available in IndexReaderUtils #2052

@djoerd

Description

@djoerd

I want to know the number of unique terms in my index and got: -1

Steps:
IndexCollection -collection TrecCollection -input /home/hiemstra/Data/robust04/ -index lucene-index.robust04.pos+docvectors -threads 16 -storePositions -storeDocvectors
IndexReaderUtils -stats -index lucene-index.robust04.pos+docvectors/

Results:
Index statistics
----------------
documents: 528030
documents (non-empty): 528030
unique terms: -1
total terms: 174540872

Turns out that: "Terms.size(): (...) may be unavailable (returns -1) for some Terms implementations such as MultiTerms where it cannot be efficiently computed.

I already solved this myself: I will add a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions