Search in sources :

Example 6 with Indexer

use of de.catma.indexer.Indexer in project catma by forTEXT.

the class CommentQuery method execute.

@Override
protected QueryResult execute() throws Exception {
    QueryOptions queryOptions = getQueryOptions();
    WildcardTermExtractor termExtractor = new WildcardTermExtractor(commentPhrase, queryOptions.getUnseparableCharacterSequences(), queryOptions.getUserDefinedSeparatingCharacters(), queryOptions.getLocale());
    List<String> termList = termExtractor.getOrderedTerms();
    Indexer indexer = queryOptions.getIndexer();
    QueryResult result = indexer.searchCommentPhrase(queryOptions.getQueryId(), queryOptions.getRelevantSourceDocumentIDs(), termList, queryOptions.getLimit(), queryOptions.getUnseparableCharacterSequences(), queryOptions.getUserDefinedSeparatingCharacters(), queryOptions.getLocale());
    Project repository = queryOptions.getRepository();
    for (QueryResultRow row : result) {
        SourceDocument sd = repository.getSourceDocument(row.getSourceDocumentId());
        row.setPhrase(sd.getContent(row.getRange()));
    }
    return result;
}
Also used : Project(de.catma.project.Project) QueryResult(de.catma.queryengine.result.QueryResult) Indexer(de.catma.indexer.Indexer) QueryResultRow(de.catma.queryengine.result.QueryResultRow) WildcardTermExtractor(de.catma.indexer.WildcardTermExtractor) SourceDocument(de.catma.document.source.SourceDocument)

Aggregations

Indexer (de.catma.indexer.Indexer)6 QueryResult (de.catma.queryengine.result.QueryResult)6 SourceDocument (de.catma.document.source.SourceDocument)5 Project (de.catma.project.Project)5 QueryResultRow (de.catma.queryengine.result.QueryResultRow)5 Range (de.catma.document.Range)3 QueryResultRowArray (de.catma.queryengine.result.QueryResultRowArray)3 TagQueryResultRow (de.catma.queryengine.result.TagQueryResultRow)3 AnnotationCollectionReference (de.catma.document.annotation.AnnotationCollectionReference)2 WildcardTermExtractor (de.catma.indexer.WildcardTermExtractor)2