public class DocumentTermsQuery extends AbstractIndexTermsQuery
TermsQuery
that returns the terms occurring in a document.annotationHelper, atomicIndex, countsEnabled, DEFAULT_STOP_WORDS, describeAnnotations, engine, indexName, indexType, stopWords, stopWordsBlocked
documentIds
Constructor and Description |
---|
DocumentTermsQuery(String indexName,
QueryEngine.IndexType indexType,
boolean countsEnabled,
boolean describeAnnotations,
long documentId)
Creates a new document term query.
|
Modifier and Type | Method and Description |
---|---|
TermsResultSet |
execute(QueryEngine engine)
Runs the term query (in the calling thread) and returns the matched terms.
|
buildResultSet, getStopWords, isCountsEnabled, isStopWordsBlocked, prepare, setStopWords, setStopWords, setStopWordsBlocked
clone, getDocumentIds, setDocumentIds
public DocumentTermsQuery(String indexName, QueryEngine.IndexType indexType, boolean countsEnabled, boolean describeAnnotations, long documentId)
documentId
- the ID of the document for which the terms are soughtindexName
- the name of the sub-index to be searched. Each MÃmir index
includes multiple sub-indexes (some storing tokens, other storing
annotations), identified by a name. For token indexes, the index
name is the name of the token feature being indexed; for
annotation indexes, the index name is the annotation type.indexType
- The type of index to be searched (tokens or annotations).countsEnabled
- should term counts be returned.describeAnnotations
- If the index being interrogated is of type
QueryEngine.IndexType.ANNOTATIONS
then the indexed term strings are
URIs whose format depends on the actual implementation of the
index. These strings make little sense outside of the index. If
this is set to true
, then term descriptions are also
included in the results set. See
TermsResultSet.termDescriptions
and
SemanticAnnotationHelper.describeMention(String)
. Setting
this to true
has no effect if the index being
interrogated is a QueryEngine.IndexType.TOKENS
index.public TermsResultSet execute(QueryEngine engine) throws IOException
TermsQuery
engine
- the QueryEngine
used to execute the search.TermsResultSet
containing the matched terms.IOException
Copyright © 2021 GATE. All rights reserved.