本文整理汇总了Java中org.apache.solr.search.ExtendedDismaxQParser类的典型用法代码示例。如果您正苦于以下问题:Java ExtendedDismaxQParser类的具体用法?Java ExtendedDismaxQParser怎么用?Java ExtendedDismaxQParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtendedDismaxQParser类属于org.apache.solr.search包,在下文中一共展示了ExtendedDismaxQParser类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParser
import org.apache.solr.search.ExtendedDismaxQParser; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
checkNotNull(req, "Pre-condition violated: req must not be null.");
// get query parsers if not available
if (queryParsingAnalyzer == null) {
this.queryParsingAnalyzer = (queryParsingFieldType != null) ? req.getSchema()
.getFieldTypeByName(queryParsingFieldType)
.getQueryAnalyzer() : null;
}
checkNotNull(queryParsingAnalyzer, "Pre-condition violated: queryParsingAnalyzer must not be null.");
// pre-process query string here
// parse and replace querystring
if (!"*:*".equals(qstr)) {
qstr = Joiner.on(' ').join(Terms.collect(qstr, queryParsingAnalyzer));
}
return new ExtendedDismaxQParser(qstr, localParams, params, req);
}
示例2: preProcessQuery
import org.apache.solr.search.ExtendedDismaxQParser; //导入依赖的package包/类
private static String preProcessQuery(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req){
// prevent white space tokenization
ExtendedDismaxQParser qParser = new ExtendedDismaxQParser(qstr.replace(" ",","), localParams, params, req);
try{
Query query = qParser.parse();
return query.toString();
}
catch (Exception ex){
return "ERROR";
}
}
示例3: createEdismaxQueryParser
import org.apache.solr.search.ExtendedDismaxQParser; //导入依赖的package包/类
@Override
protected org.apache.solr.search.ExtendedDismaxQParser.ExtendedSolrQueryParser createEdismaxQueryParser(org.apache.solr.search.QParser qParser, java.lang.String field)
{
return new TermQueryOnlyExtendedSolrQueryParser(qParser, field);
}
示例4: createEdismaxQueryParser
import org.apache.solr.search.ExtendedDismaxQParser; //导入依赖的package包/类
@Override
protected org.apache.solr.search.ExtendedDismaxQParser.ExtendedSolrQueryParser createEdismaxQueryParser(org.apache.solr.search.QParser qParser, java.lang.String field)
{
return new PayloadAwareExtendedSolrQueryParser(qParser, field);
}