• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SolrConstantScoreQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DbAttribute类代码示例发布时间:2022-05-22
下一篇:
Java RetStmt类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap