Search in sources :

Example 1 with Solr4QueryParser

use of org.alfresco.solr.query.Solr4QueryParser in project SearchServices by Alfresco.

the class AlfrescoSolrDataModel method getLuceneQueryParser.

public Solr4QueryParser getLuceneQueryParser(SearchParameters searchParameters, SolrQueryRequest req, FTSQueryParser.RerankPhase rerankPhase) {
    Analyzer analyzer = req.getSchema().getQueryAnalyzer();
    Solr4QueryParser parser = new Solr4QueryParser(req, Version.LUCENE_5_5_0, searchParameters.getDefaultFieldName(), analyzer, rerankPhase);
    parser.setNamespacePrefixResolver(namespaceDAO);
    parser.setDictionaryService(getDictionaryService(CMISStrictDictionaryService.DEFAULT));
    parser.setTenantService(tenantService);
    parser.setSearchParameters(searchParameters);
    parser.setAllowLeadingWildcard(true);
    Properties props = new CoreDescriptorDecorator(req.getCore().getCoreDescriptor()).getProperties();
    int topTermSpanRewriteLimit = Integer.parseInt(props.getProperty("alfresco.topTermSpanRewriteLimit", "1000"));
    parser.setTopTermSpanRewriteLimit(topTermSpanRewriteLimit);
    return parser;
}
Also used : CoreDescriptorDecorator(org.apache.solr.core.CoreDescriptorDecorator) Solr4QueryParser(org.alfresco.solr.query.Solr4QueryParser) Analyzer(org.apache.lucene.analysis.Analyzer) Properties(java.util.Properties) Constraint(org.alfresco.repo.search.impl.querymodel.Constraint)

Aggregations

Properties (java.util.Properties)1 Constraint (org.alfresco.repo.search.impl.querymodel.Constraint)1 Solr4QueryParser (org.alfresco.solr.query.Solr4QueryParser)1 Analyzer (org.apache.lucene.analysis.Analyzer)1 CoreDescriptorDecorator (org.apache.solr.core.CoreDescriptorDecorator)1