本文整理汇总了Java中org.apache.solr.search.SolrConstantScoreQuery类的典型用法代码示例。如果您正苦于以下问题:Java SolrConstantScoreQuery类的具体用法?Java SolrConstantScoreQuery怎么用?Java SolrConstantScoreQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SolrConstantScoreQuery类属于org.apache.solr.search包,在下文中一共展示了SolrConstantScoreQuery类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parse
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
@Override
public Query parse() throws SyntaxError {
String filter = localParams.get(getParentFilterLocalParamName());
QParser parentParser = subQuery(filter, null);
Query parentQ = parentParser.getQuery();
String queryText = localParams.get(QueryParsing.V);
// there is no child query, return parent filter from cache
if (queryText == null || queryText.length()==0) {
SolrConstantScoreQuery wrapped = new SolrConstantScoreQuery(getFilter(parentQ));
wrapped.setCache(false);
return wrapped;
}
QParser childrenParser = subQuery(queryText, null);
Query childrenQuery = childrenParser.getQuery();
return createQuery(parentQ, childrenQuery);
}
开发者ID:europeana,项目名称:search,代码行数:18,代码来源:BlockJoinParentQParser.java
示例2: getRangeQuery
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
public Query getRangeQuery(QParser parser, SchemaField field, final CurrencyValue p1, final CurrencyValue p2, final boolean minInclusive, final boolean maxInclusive) {
String currencyCode = (p1 != null) ? p1.getCurrencyCode() :
(p2 != null) ? p2.getCurrencyCode() : defaultCurrency;
// ValueSourceRangeFilter doesn't check exists(), so we have to
final Filter docsWithValues = new FieldValueFilter(getAmountField(field).getName());
final Filter vsRangeFilter = new ValueSourceRangeFilter
(new RawCurrencyValueSource(field, currencyCode, parser),
p1 == null ? null : p1.getAmount() + "",
p2 == null ? null : p2.getAmount() + "",
minInclusive, maxInclusive);
final Filter docsInRange = new ChainedFilter
(new Filter [] { docsWithValues, vsRangeFilter }, ChainedFilter.AND);
return new SolrConstantScoreQuery(docsInRange);
}
开发者ID:europeana,项目名称:search,代码行数:18,代码来源:CurrencyField.java
示例3: parse
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
@Override
public Query parse() throws SyntaxError {
if (localParams == null) {
throw new SyntaxError ("join query parser must be invoked using localParams");
}
String filter = localParams.get(getParentFilterLocalParamName());
QParser parentParser = subQuery(filter, null);
Query parentQ = parentParser.getQuery();
String queryText = localParams.get(QueryParsing.V);
// there is no child query, return parent filter from cache
if (queryText == null || queryText.length()==0) {
SolrConstantScoreQuery wrapped = new SolrConstantScoreQuery(getFilter(parentQ));
wrapped.setCache(false);
return wrapped;
}
QParser childrenParser = subQuery(queryText, null);
Query childrenQuery = childrenParser.getQuery();
return createQuery(parentQ, childrenQuery);
}
开发者ID:safarijv,项目名称:ifpress-solr-plugin,代码行数:21,代码来源:ScoringParentQParser.java
示例4: parse
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Query parse() throws SyntaxError {
Method method = Method.valueOf(localParams.get(METHOD, Method.termsFilter.name()));
JoinSpec<T> js = JoinSpec.parse(localParams.get(QueryParsing.V));
Iterator<T> it = js.iterator(this);
if (joinField == null) {
throw new Exception("No XJoin component referenced by query");
}
FieldType ft = req.getSchema().getFieldTypeNoEx(joinField);
Iterator<BytesRef> bytesRefs = new TransformIterator(it, transformer(ft));
if (! bytesRefs.hasNext()) {
return new BooleanQuery.Builder().build(); // matches nothing
}
Query query = method.makeQuery(joinField, bytesRefs);
return new SolrConstantScoreQuery(new QueryWrapperFilter(query));
}
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:18,代码来源:XJoinQParserPlugin.java
示例5: parse
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Query parse() throws SyntaxError {
Method method = Method.valueOf(localParams.get(METHOD, Method.termsFilter.name()));
JoinSpec<T> js = JoinSpec.parse(localParams.get(QueryParsing.V));
Iterator<T> it = js.iterator(this);
if (joinField == null) {
throw new Exception("No XJoin component referenced by query");
}
FieldType ft = req.getSchema().getFieldTypeNoEx(joinField);
Iterator<BytesRef> bytesRefs = new TransformIterator(it, transformer(ft));
if (! bytesRefs.hasNext()) {
return new BooleanQuery(); // matches nothing
}
return new SolrConstantScoreQuery(method.makeFilter(joinField, bytesRefs));
}
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:17,代码来源:XJoinQParserPlugin.java
示例6: createSpatialQuery
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
@Override
public Query createSpatialQuery(QParser parser, SpatialOptions options) {
String geohash = toInternal(options.pointStr);
//TODO: optimize this
return new SolrConstantScoreQuery(new ValueSourceRangeFilter(new GeohashHaversineFunction(getValueSource(options.field, parser),
new LiteralValueSource(geohash), options.radius), "0", String.valueOf(options.distance), true, true));
}
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:GeoHashField.java
示例7: createSpatialQuery
import org.apache.solr.search.SolrConstantScoreQuery; //导入依赖的package包/类
@Override
public Query createSpatialQuery(QParser parser, SpatialOptions options) {
double [] point = new double[0];
try {
point = ParseUtils.parsePointDouble(null, options.pointStr, 2);
} catch (InvalidShapeException e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
}
String geohash = GeohashUtils.encodeLatLon(point[0], point[1]);
//TODO: optimize this
return new SolrConstantScoreQuery(new ValueSourceRangeFilter(new GeohashHaversineFunction(getValueSource(options.field, parser),
new LiteralValueSource(geohash), options.radius), "0", String.valueOf(options.distance), true, true));
}
开发者ID:pkarmstr,项目名称:NYBC,代码行数:14,代码来源:GeoHashField.java
注:本文中的org.apache.solr.search.SolrConstantScoreQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论