Contents

SKIndexGetTermDocumentCount(_:_:)

Gets the number of documents containing a given term represented in an index.

Declaration

func SKIndexGetTermDocumentCount(_ inIndex: SKIndex!, _ inTermID: CFIndex) -> CFIndex

Parameters

  • inIndex:

    The index containing the text of the documents you want to examine.

  • inTermID:

    The terms whose occurrences you want to know.

Return Value

A CFIndex object containing the number of documents represented in an index that contain a given term.

Discussion

If you want to know in which documents a term appears across multiple indexes, call this function separately on each index. Before querying each index, get the index-specific term ID using SKIndexGetTermIDForTermString(_:_:).

To ensure that this function takes into account document URL objects (of type SKDocument) recently added to indexes, call SKIndexFlush(_:) on each index before calling this function.

See Also

Working with Documents and Terms