本文整理匯總了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);
}