use of org.alfresco.repo.search.impl.querymodel.QueryOptions in project alfresco-repository by Alfresco.
the class AbstractAlfrescoFtsQueryLanguage method executeQuery.
public ResultSet executeQuery(SearchParameters searchParameters) {
String ftsExpression = searchParameters.getQuery();
QueryModelFactory factory = queryEngine.getQueryModelFactory();
AlfrescoFunctionEvaluationContext context = new AlfrescoFunctionEvaluationContext(namespaceService, dictionaryService, searchParameters.getNamespace());
QueryOptions options = QueryOptions.create(searchParameters);
FTSParser.Mode mode;
if (options.getDefaultFTSConnective() == Connective.AND) {
mode = FTSParser.Mode.DEFAULT_CONJUNCTION;
} else {
mode = FTSParser.Mode.DEFAULT_DISJUNCTION;
}
Constraint constraint = FTSQueryParser.buildFTS(ftsExpression, factory, context, null, null, mode, options.getDefaultFTSFieldConnective(), searchParameters.getQueryTemplates(), options.getDefaultFieldName(), FTSQueryParser.RerankPhase.SINGLE_PASS);
org.alfresco.repo.search.impl.querymodel.Query query = factory.createQuery(null, null, constraint, buildOrderings(factory, searchParameters));
QueryEngineResults results = queryEngine.executeQuery(query, options, context);
ResultSet resultSet = results.getResults().values().iterator().next();
return resultSet;
}
Aggregations