org.apache.lucene.search.Query.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中org.apache.lucene.search.Query.hashCode方法的一些代码示例,展示了Query.hashCode的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.hashCode方法的具体详情如下:
包路径:org.apache.lucene.search.Query
类名称:Query
方法名:hashCode

Query.hashCode介绍

[英]Override and implement query hash code properly in a subclass. This is required so that QueryCache works properly.
[中]在子类中正确重写和实现查询哈希代码。这是QueryCache正常工作所必需的。

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core

  1. @Override
  2. public int hashCode() {
  3. int h = classHash();
  4. h = 31 * h + indexQuery.hashCode();
  5. h = 31 * h + dvQuery.hashCode();
  6. return h;
  7. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. int frequency(Query query) {
  2. assert query instanceof BoostQuery == false;
  3. assert query instanceof ConstantScoreQuery == false;
  4. // call hashCode outside of sync block
  5. // in case it's somewhat expensive:
  6. int hashCode = query.hashCode();
  7. synchronized (this) {
  8. return recentlyUsedFilters.frequency(hashCode);
  9. }
  10. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. @Override
  2. public int hashCode() {
  3. int h = classHash();
  4. h = 31 * h + query.hashCode();
  5. h = 31 * h + Float.floatToIntBits(boost);
  6. return h;
  7. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. @Override
  2. public int hashCode() {
  3. return 31 * classHash() + query.hashCode();
  4. }
  5. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. /** Returns a hash code value for this object.*/
  2. @Override
  3. public int hashCode() {
  4. return 31 * query.hashCode() + occur.hashCode();
  5. }

代码示例来源:origin: org.apache.lucene/lucene-core

  1. @Override
  2. public void onUse(Query query) {
  3. assert query instanceof BoostQuery == false;
  4. assert query instanceof ConstantScoreQuery == false;
  5. if (shouldNeverCache(query)) {
  6. return;
  7. }
  8. // call hashCode outside of sync block
  9. // in case it's somewhat expensive:
  10. int hashCode = query.hashCode();
  11. // we only track hash codes to avoid holding references to possible
  12. // large queries; this may cause rare false positives, but at worse
  13. // this just means we cache a query that was not in fact used enough:
  14. synchronized (this) {
  15. recentlyUsedFilters.add(hashCode);
  16. }
  17. }

代码示例来源:origin: org.elasticsearch/elasticsearch

  1. @Override
  2. public int hashCode() {
  3. return 31 * getClass().hashCode() + query.hashCode();
  4. }
  5. }

代码示例来源:origin: com.atlassian.jira/jira-api

  1. @Override
  2. public int hashCode()
  3. {
  4. int result = luceneQuery.hashCode();
  5. result = 31 * result + (mustNotOccur ? 1 : 0);
  6. return result;
  7. }

代码示例来源:origin: hibernate/hibernate-search

  1. @Override
  2. public int hashCode() {
  3. int hashCode = 31 * super.hashCode() + spatialHashCellsIds.hashCode();
  4. hashCode = 31 * hashCode + fieldName.hashCode();
  5. return hashCode;
  6. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. /** Returns a hash code value for this object.*/
  2. @Override
  3. public int hashCode() {
  4. int h = super.hashCode();
  5. h = 31 * h + slop;
  6. h = 31 * h + terms.hashCode();
  7. h = 31 * h + positions.hashCode();
  8. return h;
  9. }

代码示例来源:origin: kzwang/elasticsearch-image

  1. @Override
  2. public int hashCode() {
  3. int result = super.hashCode();
  4. result = 31 * result + hashFieldName.hashCode();
  5. result = 31 * result + Arrays.hashCode(hashes);
  6. result = 31 * result + maxResult;
  7. result = 31 * result + luceneFieldName.hashCode();
  8. result = 31 * result + lireFeature.hashCode();
  9. return result;
  10. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. @Override
  2. public int hashCode() {
  3. int h = super.hashCode();
  4. h = 31 * h + Arrays.hashCode(terms);
  5. h = 31 * h + Arrays.hashCode(contexts);
  6. h = 31 * h + Arrays.hashCode(boosts);
  7. h = 31 * h + rewriteMethod.hashCode();
  8. return h;
  9. }

代码示例来源:origin: hibernate/hibernate-search

  1. @Override
  2. public int hashCode() {
  3. int hashCode = 31 * super.hashCode() + approximationQuery.hashCode();
  4. hashCode = 31 * hashCode + center.hashCode();
  5. hashCode = 31 * hashCode + Double.hashCode( radius );
  6. hashCode = 31 * hashCode + Objects.hashCode( coordinatesField );
  7. hashCode = 31 * hashCode + Objects.hashCode( latitudeField );
  8. hashCode = 31 * hashCode + Objects.hashCode( longitudeField );
  9. return hashCode;
  10. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. int frequency(Query query) {
  2. assert query instanceof BoostQuery == false;
  3. assert query instanceof ConstantScoreQuery == false;
  4. // call hashCode outside of sync block
  5. // in case it's somewhat expensive:
  6. int hashCode = query.hashCode();
  7. synchronized (this) {
  8. return recentlyUsedFilters.frequency(hashCode);
  9. }
  10. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. @Override
  2. public int hashCode() {
  3. return super.hashCode() ^ func.hashCode();
  4. }
  5. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

  1. /** Returns a hash code value for this object.*/
  2. @Override
  3. public int hashCode() {
  4. return 31 * query.hashCode() + occur.hashCode();
  5. }

代码示例来源:origin: kzwang/elasticsearch-image

  1. @Override
  2. public int hashCode() {
  3. int result = super.hashCode();
  4. result = 31 * result + term.hashCode();
  5. result = 31 * result + luceneFieldName.hashCode();
  6. result = 31 * result + lireFeature.hashCode();
  7. result = Float.floatToIntBits(getBoost()) ^ result;
  8. return result;
  9. }
  10. }

代码示例来源:origin: org.infinispan/infinispan-embedded-query

  1. @Override
  2. public int hashCode() {
  3. return super.hashCode()
  4. ^ fieldName.hashCode()
  5. ^ qf.hashCode()
  6. ^ srndQuery.hashCode();
  7. }

代码示例来源:origin: org.apache.lucene/lucene-queries

  1. @Override
  2. public int hashCode() {
  3. int h = classHash();
  4. h = 31 * h + q.hashCode();
  5. h = 31 * h + boostVal.hashCode();
  6. return h;
  7. }

代码示例来源:origin: org.apache.lucene/lucene-spatial-extras

  1. @Override
  2. public int hashCode() {
  3. int result = classHash();
  4. result = 31 * result + indexQuery.hashCode();
  5. result = 31 * result + predicateValueSource.hashCode();
  6. return result;
  7. }

相关文章