Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
c3533a7
FeatureRequest17599: Enhancing Terms lookup query to take a query cla…
srikanthpadakanti May 2, 2025
5d07141
Checkpoint 2 fixed the index issue when query is null
srikanthpadakanti May 3, 2025
25a2bf8
Checkpoint 3 fixed the optional argument id, query handling
srikanthpadakanti May 3, 2025
da93337
Debugging the parsing issue
srikanthpadakanti May 5, 2025
cbafd35
Address the PR comments
srikanthpadakanti May 9, 2025
6cc6ab0
Both id and query is working checkpoint
srikanthpadakanti May 14, 2025
1cd1dd5
Both id and query is working checkpoint
srikanthpadakanti May 14, 2025
a95a3b5
Both id and query is working and basic unittests
srikanthpadakanti May 14, 2025
ba6785a
Fix: Ensure TermsLookup supports both id and query; added validation …
srikanthpadakanti May 15, 2025
f560563
Fix: Ensure TermsLookup supports both id and query; added validation …
srikanthpadakanti May 15, 2025
741290d
Fix: Ensure TermsLookup supports both id and query; added validation …
srikanthpadakanti May 15, 2025
f4af35e
Fix: Ensure TermsLookup supports both id and query; added validation …
srikanthpadakanti May 15, 2025
8e5330f
Add CHANGELOG entry for feature request #17599
srikanthpadakanti May 15, 2025
6ab5410
Add CHANGELOG entry for feature request #17599
srikanthpadakanti May 15, 2025
101c8ad
Add retry logic to gradle wrapper validation
srikanthpadakanti May 15, 2025
deb10b5
Fix the unittests for TermsLookup constructor and fix the serializati…
srikanthpadakanti May 16, 2025
1d2d30e
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti May 16, 2025
43d9534
spotlessApply
srikanthpadakanti May 16, 2025
416169f
Fix teh unittests and TermsLookup Constructor
srikanthpadakanti May 16, 2025
1de3851
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti May 19, 2025
2ddb9c3
Merge branch 'main' into FeatureRequest17599
srikanthpadakanti May 19, 2025
f84fcb6
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti May 19, 2025
33e47bf
Add the test to cover the missing part as per codecoverage report
srikanthpadakanti May 19, 2025
29c4d55
spotlessApply
srikanthpadakanti May 19, 2025
ab7abdb
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti May 20, 2025
c2e6d01
Merge branch 'main' into FeatureRequest17599
srikanthpadakanti Jun 27, 2025
c8134ad
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 10, 2025
7a6bf76
Enhancing Terms lookup query to take a query clause rather than docId
Jul 11, 2025
f831ac6
Enhancing Terms lookup query to take a query clause rather than docId
Jul 11, 2025
5e575f9
spotlessApply
Jul 11, 2025
bfc9dfc
Remove IDE config file from PR
Jul 11, 2025
d3db32d
Remove duplicate ser/deser code
Jul 11, 2025
ac8c291
Fix forbidden API usage: use toLowerCase(Locale.ROOT) in TermQueryWit…
Jul 11, 2025
80733bd
Fix forbidden API usage: use toLowerCase(Locale.ROOT) in TermQueryWit…
Jul 11, 2025
bbc87d8
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 14, 2025
7def0b3
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 14, 2025
5369170
FeatureRequest17599 - use nodeclient instead of shardcontext in the a…
Jul 14, 2025
27afa59
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 15, 2025
94c162b
FeatureRequest17599 - use nodeclient instead of shardcontext in the a…
Jul 15, 2025
b3d9979
FeatureRequest17599 - use nodeclient instead of shardcontext in the a…
Jul 15, 2025
e52dc63
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 15, 2025
461c513
FeatureRequest17599 - use nodeclient instead of shardcontext in the a…
Jul 15, 2025
02eafe3
FeatureRequest17599 - use nodeclient instead of shardcontext in the a…
Jul 15, 2025
603582b
Fixed Tests
Jul 15, 2025
ca067f0
Fixed Tests
Jul 15, 2025
5f824e9
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 15, 2025
5b5f120
Fixed Tests
Jul 16, 2025
ecedd4a
Fixed Tests
Jul 16, 2025
0be323f
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 16, 2025
cb56276
Fixed Tests
Jul 16, 2025
6623319
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 16, 2025
21bf84e
Fixed Tests
Jul 16, 2025
c60bd04
Fixed Tests
Jul 16, 2025
ad0002e
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 17, 2025
d3a67e5
Fixed on or after version for query parameter
Jul 17, 2025
ce4e675
Restore .idea/runConfigurations/Debug_OpenSearch.xml
Jul 17, 2025
d968ab8
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 20, 2025
3ab8f54
Fix the regression test failute
Jul 24, 2025
2a22622
Merge changes from upstream to feature branch
Jul 24, 2025
ef8b7d9
Merge changes from upstream
Jul 25, 2025
93c5eae
Merge changes from upstream
Jul 25, 2025
4efea61
Add anotehr test to validate the async path
Jul 28, 2025
514f8f6
Add anotehr test to validate the async path
Jul 28, 2025
4f0443c
Add few unit tests for TermsLookup
Jul 28, 2025
1f1a644
Add few unit tests for TermsLookup
Jul 28, 2025
f3df5e7
Add few unit tests for TermsLookup
Jul 28, 2025
15f400e
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 28, 2025
7c13076
Merge upstream changes into the branch
Jul 28, 2025
f8c34bd
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 28, 2025
edf0f7c
Address the PR comments and resolve them
Jul 28, 2025
e008cda
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 29, 2025
efd92c5
Add the edge test case scenarios for the termslookup query using query
Jul 29, 2025
a9a25ad
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 29, 2025
55d7667
Trigger Mend scan by modifying supported file/dependency
Jul 29, 2025
5a53b7c
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 30, 2025
314c759
Remove the licensing info from the newly added test file
Jul 30, 2025
49176e2
Add licensing information according to guidelines
Jul 30, 2025
6420203
Skip terms query lookup by query REST tests on 3.1.99 and below
Jul 30, 2025
745d68d
Skip terms query lookup by query REST tests on 3.1.99 and below
Jul 30, 2025
ebcf4b8
Skip terms query lookup by query REST tests on 3.1.99 and below versions
Jul 30, 2025
f1a98a1
Skip terms query lookup by query REST tests on 3.1.99 and below versions
Jul 30, 2025
620d81d
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 31, 2025
a1d7082
Skip terms query lookup by query REST tests on 3.1.99 and below versions
Jul 31, 2025
6afb0f7
Address the PR comments and add unittests to the new changes
Jul 31, 2025
d39a2f9
Address the PR comments and add unittests to the new changes
Jul 31, 2025
87ec917
Address the PR comments and add unittests to the new changes
Jul 31, 2025
2774f72
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 31, 2025
ecafcf4
Merge branch 'opensearch-project:main' into FeatureRequest17599
srikanthpadakanti Jul 31, 2025
ae9d422
Address the PR comments
Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased 3.x]
### Added
- [Feature Request] Enhance Terms lookup query to support query clause instead of docId ([#18195](https://github.com/opensearch-project/OpenSearch/issues/18195))
- Add hierarchical routing processors for ingest and search pipelines ([#18826](https://github.com/opensearch-project/OpenSearch/pull/18826))
- Add support for Warm Indices Write Block on Flood Watermark breach ([#18375](https://github.com/opensearch-project/OpenSearch/pull/18375))
- FS stats for warm nodes based on addressable space ([#18767](https://github.com/opensearch-project/OpenSearch/pull/18767))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
---
"Terms Query - Lookup by Query":
# --- SKIP IF VERSION IS LESS THAN 3.2.0 --- #
- skip:
version: " - 3.1.99"
reason: All tests in this file require features added in 3.2.0 or later (terms query lookup by query).

# --- SETUP: CREATE INDICES AND POPULATE DATA --- #
- do:
indices.create:
index: lookup_index
body:
settings:
number_of_replicas: 0
# Wait for index to be fully ready (avoids race in multi-node clusters)
- do:
cluster.health:
index: lookup_index
wait_for_status: green
timeout: 30s
- do:
indices.create:
index: main_index
body:
settings:
number_of_replicas: 0
- do:
cluster.health:
index: main_index
wait_for_status: green
timeout: 30s

# Populate lookup_index
- do:
bulk:
refresh: true
body: |
{ "index": { "_index": "lookup_index", "_id": "1" } }
{ "group": "g1", "followers": ["foo", "bar"], "tag": "a" }
{ "index": { "_index": "lookup_index", "_id": "2" } }
{ "group": "g1", "followers": ["baz"], "tag": "b" }
{ "index": { "_index": "lookup_index", "_id": "3" } }
{ "group": "g2", "followers": null, "tag": "c" }
{ "index": { "_index": "lookup_index", "_id": "4" } }
{ "group": "g1", "tag": "d" }
{ "index": { "_index": "lookup_index", "_id": "5" } }
{ "group": "g1", "followers": ["baz"], "tag": "e" }
{ "index": { "_index": "lookup_index", "_id": "6" } }
{ "group": "g3", "followers": [], "tag": "f" }
- match: { errors: false }

# Populate main_index
- do:
bulk:
refresh: true
body: |
{ "index": { "_index": "main_index", "_id": "u1" } }
{ "user": "foo" }
{ "index": { "_index": "main_index", "_id": "u2" } }
{ "user": "bar" }
{ "index": { "_index": "main_index", "_id": "u3" } }
{ "user": "baz" }
{ "index": { "_index": "main_index", "_id": "u4" } }
{ "user": "qux" }
{ "index": { "_index": "main_index", "_id": "u5" } }
{ "user": "foo" }
- match: { errors: false }

- do:
cluster.health:
index: lookup_index,main_index
wait_for_status: green
timeout: 30s

# --- TEST CASES --- #

# Match all docs in lookup_index with group=g1, use their 'followers' as terms
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
term:
group: "g1"
- match: { hits.total: 4 } # foo (u1), bar (u2), baz (u3), foo (u5)

# Query returns docs, but some have missing/null/empty field
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
terms:
tag: ["a", "c", "f"]
- match: { hits.total: 3 } # foo (u1), bar (u2), foo (u5)

# Query returns docs but field is always empty list
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
term:
tag: "d"
- match: { hits.total: 0 } # No terms found

# Query returns docs but field is scalar, not array (now array, see above)
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
term:
tag: "e"
- match: { hits.total: 1 } # Only user baz (from doc 5: followers=["baz"])

# Query returns no docs
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
term:
tag: "zzz"
- match: { hits.total: 0 }

# Query returns docs, some with missing field, some with lists, some with nulls
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
terms:
tag: ["a", "b", "c", "d", "e", "f"]
- match: { hits.total: 4 } # foo (u1), bar (u2), baz (u3), foo (u5)

# Duplicates across docs should be deduplicated (foo appears in 2 docs)
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: followers
query:
terms:
tag: ["a", "b"]
- match: { hits.total: 4 } # foo (u1), bar (u2), baz (u3), foo (u5)

# Query returns docs but none have the field specified.
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
terms:
user:
index: lookup_index
path: not_a_field
query:
match_all: {}
- match: { hits.total: 0 }

# Optional: sanity check for main_index docs
- do:
search:
rest_total_hits_as_int: true
index: main_index
body:
query:
match_all: {}
- match: { hits.total: 5 } # Should always be 5
Loading
Loading