lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject [1/2] lucene-solr:branch_6x: LUCENE-7492: Fix LRUQueryCache javadocs.
Date Wed, 12 Oct 2016 14:41:07 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 86b03358d -> f10312a4c
  refs/heads/master 1b7a88f61 -> 175370f23


LUCENE-7492: Fix LRUQueryCache javadocs.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f10312a4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f10312a4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f10312a4

Branch: refs/heads/branch_6x
Commit: f10312a4c451a54e1bae77daabd52ffeb087d155
Parents: 86b0335
Author: Adrien Grand <jpountz@gmail.com>
Authored: Wed Oct 12 16:27:58 2016 +0200
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Wed Oct 12 16:40:43 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/lucene/search/LRUQueryCache.java  | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f10312a4/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java b/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
index 1bcdca1..3ea704e 100644
--- a/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
+++ b/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
@@ -56,7 +56,8 @@ import org.apache.lucene.util.RoaringDocIdSet;
  * {@link QueryCachingPolicy caching policies} that only cache on "large"
  * segments, and it is advised to not share this cache across too many indices.
  *
- * Typical usage looks like this:
+ * A default query cache and policy instance is used in IndexSearcher. If you want to replace
those defaults
+ * it is typically done like this:
  * <pre class="prettyprint">
  *   final int maxNumberOfCachedQueries = 256;
  *   final long maxRamBytesUsed = 50 * 1024L * 1024L; // 50MB
@@ -64,15 +65,8 @@ import org.apache.lucene.util.RoaringDocIdSet;
  *   // it is fine to eg. store them into static variables
  *   final QueryCache queryCache = new LRUQueryCache(maxNumberOfCachedQueries, maxRamBytesUsed);
  *   final QueryCachingPolicy defaultCachingPolicy = new UsageTrackingQueryCachingPolicy();
- *
- *   // ...
- *
- *   // Then at search time
- *   Query myQuery = ...;
- *   Query myCacheQuery = queryCache.doCache(myQuery, defaultCachingPolicy);
- *   // myCacheQuery is now a wrapper around the original query that will interact with the
cache
- *   IndexSearcher searcher = ...;
- *   TopDocs topDocs = searcher.search(new ConstantScoreQuery(myCacheQuery), 10);
+ *   indexSearcher.setQueryCache(queryCache);
+ *   indexSearcher.setQueryCachingPolicy(defaultCachingPolicy);
  * </pre>
  *
  * This cache exposes some global statistics ({@link #getHitCount() hit count},


Mime
View raw message