Skip to content

Commit

Permalink
Change cacheable to false
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Aug 30, 2024
1 parent 8ae0461 commit eabba0b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Workload Management] Add query group stats constructs ([#15343](https://github.com/opensearch-project/OpenSearch/pull/15343)))
- Add runAs to Subject interface and introduce IdentityAwarePlugin extension point ([#14630](https://github.com/opensearch-project/OpenSearch/pull/14630))
- Optimize NodeIndicesStats output behind flag ([#14454](https://github.com/opensearch-project/OpenSearch/pull/14454))
- [Workload Management] Add rejection logic for co-ordinator and shard level requests ([#15428](https://github.com/opensearch-project/OpenSearch/pull/15428)))
- Adding translog durability validation in index templates ([#15494](https://github.com/opensearch-project/OpenSearch/pull/15494))
- Add index creation using the context field ([#15290](https://github.com/opensearch-project/OpenSearch/pull/15290))
- [Range Queries] Add new approximateable query framework to short-circuit range queries ([#13788](https://github.com/opensearch-project/OpenSearch/pull/13788))

### Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public int count(LeafReaderContext context) throws IOException {

@Override
public boolean isCacheable(LeafReaderContext ctx) {
return true;
return false;
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Weight;
import org.opensearch.search.internal.SearchContext;

Expand Down Expand Up @@ -42,18 +41,10 @@ public ApproximateQuery getApproximationQuery() {
return approximationQuery;
}

@Override
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException {
if (resolvedQuery == null) {
throw new IllegalStateException("Cannot create weight without setContext being called");
}
return resolvedQuery.createWeight(searcher, scoreMode, boost);
}

@Override
public final Query rewrite(IndexSearcher indexSearcher) throws IOException {
if (resolvedQuery == null) {
throw new IllegalStateException("Cannot create weight without setContext being called");
throw new IllegalStateException("Cannot rewrite resolved query without setContext being called");
}
return resolvedQuery.rewrite(indexSearcher);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected String toString(int dimension, byte[] value) {
try {
IndexSearcher searcher = new IndexSearcher(reader);
searcher.search(query, 10);
Weight weight = query.createWeight(searcher, ScoreMode.TOP_SCORES, 1.0F);
Weight weight = query.rewrite(searcher).createWeight(searcher, ScoreMode.TOP_SCORES, 1.0F);
Scorer scorer = weight.scorer(reader.leaves().get(0));
assertEquals(
scorer,
Expand Down

0 comments on commit eabba0b

Please sign in to comment.