-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation for match_only_text field #11039
Implementation for match_only_text field #11039
Conversation
e437959
to
0f5485c
Compare
Gradle Check (Jenkins) Run Completed with:
|
Compatibility status:Checks if related components are compatible with change f1fb443 Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/performance-analyzer.git] |
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
❌ Gradle check result for ccab297: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for a9d1f6d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 05d96bd: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 6fdb8da: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
6fdb8da
to
2fdc207
Compare
❌ Gradle check result for 2fdc207: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for e213f84: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for c20df4a: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for c6ce7f9: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for e2c1886: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
f9fc10f
to
b765a36
Compare
❌ Gradle check result for f9fc10f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for b765a36: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 40e205e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Rishabh Maurya <[email protected]>
…teg tests Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
Signed-off-by: Rishabh Maurya <[email protected]>
2bdec4b
to
e879baf
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11039 +/- ##
============================================
- Coverage 71.47% 71.40% -0.07%
+ Complexity 59253 59240 -13
============================================
Files 4907 4909 +2
Lines 278248 278426 +178
Branches 40428 40460 +32
============================================
- Hits 198871 198817 -54
- Misses 62850 63093 +243
+ Partials 16527 16516 -11 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one changelog entry nitpick
Signed-off-by: Rishabh Maurya <[email protected]>
❕ Gradle check result for f1fb443: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
* Implementation for match_only_text field Signed-off-by: Rishabh Maurya <[email protected]> * Fix build failures Signed-off-by: Rishabh Maurya <[email protected]> * Fix bugs Signed-off-by: Rishabh Maurya <[email protected]> * Added mapper tests, stil failing on prefix and phrase tests Signed-off-by: Rishabh Maurya <[email protected]> * Disable index prefix and phrase mapper Signed-off-by: Rishabh Maurya <[email protected]> * Added unit tests for phrase and multiphrase query validation Signed-off-by: Rishabh Maurya <[email protected]> * Add unit tests for prefix and prefix phrase queries Signed-off-by: Rishabh Maurya <[email protected]> * Add a test to cover 3 word with synonym match phrase prefix query Signed-off-by: Rishabh Maurya <[email protected]> * Add unit test for SourceFieldMatchQuery Signed-off-by: Rishabh Maurya <[email protected]> * Added test for _source disabled case Signed-off-by: Rishabh Maurya <[email protected]> * Add unit test for missing field Signed-off-by: Rishabh Maurya <[email protected]> * more validation tests and changelog update Signed-off-by: Rishabh Maurya <[email protected]> * Added integration tests for match_only_text replicating text field integ tests Signed-off-by: Rishabh Maurya <[email protected]> * Added skip section in integ test to fix mixed cluster failures Signed-off-by: Rishabh Maurya <[email protected]> * remove unused import Signed-off-by: Rishabh Maurya <[email protected]> * Address PR comments Signed-off-by: Rishabh Maurya <[email protected]> * fix integ tests Signed-off-by: Rishabh Maurya <[email protected]> * Fix flaky test due to random indexwriter Signed-off-by: Rishabh Maurya <[email protected]> * pr comment: header modification Signed-off-by: Rishabh Maurya <[email protected]> * Address PR comments Signed-off-by: Rishabh Maurya <[email protected]> * addded change to the right section of CHANGELOG Signed-off-by: Rishabh Maurya <[email protected]> * overriding the textFieldType before every test Signed-off-by: Rishabh Maurya <[email protected]> * rename @before method Signed-off-by: Rishabh Maurya <[email protected]> * update changelog description Signed-off-by: Rishabh Maurya <[email protected]> --------- Signed-off-by: Rishabh Maurya <[email protected]> (cherry picked from commit 7b1c2c7) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Implementation for match_only_text field * Fix build failures * Fix bugs * Added mapper tests, stil failing on prefix and phrase tests * Disable index prefix and phrase mapper * Added unit tests for phrase and multiphrase query validation * Add unit tests for prefix and prefix phrase queries * Add a test to cover 3 word with synonym match phrase prefix query * Add unit test for SourceFieldMatchQuery * Added test for _source disabled case * Add unit test for missing field * more validation tests and changelog update * Added integration tests for match_only_text replicating text field integ tests * Added skip section in integ test to fix mixed cluster failures * remove unused import * Address PR comments * fix integ tests * Fix flaky test due to random indexwriter * pr comment: header modification * Address PR comments * addded change to the right section of CHANGELOG * overriding the textFieldType before every test * rename @before method * update changelog description --------- (cherry picked from commit 7b1c2c7) Signed-off-by: Rishabh Maurya <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Implementation for match_only_text field Signed-off-by: Rishabh Maurya <[email protected]> * Fix build failures Signed-off-by: Rishabh Maurya <[email protected]> * Fix bugs Signed-off-by: Rishabh Maurya <[email protected]> * Added mapper tests, stil failing on prefix and phrase tests Signed-off-by: Rishabh Maurya <[email protected]> * Disable index prefix and phrase mapper Signed-off-by: Rishabh Maurya <[email protected]> * Added unit tests for phrase and multiphrase query validation Signed-off-by: Rishabh Maurya <[email protected]> * Add unit tests for prefix and prefix phrase queries Signed-off-by: Rishabh Maurya <[email protected]> * Add a test to cover 3 word with synonym match phrase prefix query Signed-off-by: Rishabh Maurya <[email protected]> * Add unit test for SourceFieldMatchQuery Signed-off-by: Rishabh Maurya <[email protected]> * Added test for _source disabled case Signed-off-by: Rishabh Maurya <[email protected]> * Add unit test for missing field Signed-off-by: Rishabh Maurya <[email protected]> * more validation tests and changelog update Signed-off-by: Rishabh Maurya <[email protected]> * Added integration tests for match_only_text replicating text field integ tests Signed-off-by: Rishabh Maurya <[email protected]> * Added skip section in integ test to fix mixed cluster failures Signed-off-by: Rishabh Maurya <[email protected]> * remove unused import Signed-off-by: Rishabh Maurya <[email protected]> * Address PR comments Signed-off-by: Rishabh Maurya <[email protected]> * fix integ tests Signed-off-by: Rishabh Maurya <[email protected]> * Fix flaky test due to random indexwriter Signed-off-by: Rishabh Maurya <[email protected]> * pr comment: header modification Signed-off-by: Rishabh Maurya <[email protected]> * Address PR comments Signed-off-by: Rishabh Maurya <[email protected]> * addded change to the right section of CHANGELOG Signed-off-by: Rishabh Maurya <[email protected]> * overriding the textFieldType before every test Signed-off-by: Rishabh Maurya <[email protected]> * rename @before method Signed-off-by: Rishabh Maurya <[email protected]> * update changelog description Signed-off-by: Rishabh Maurya <[email protected]> --------- Signed-off-by: Rishabh Maurya <[email protected]>
* Implementation for match_only_text field Signed-off-by: Rishabh Maurya <[email protected]> * Fix build failures Signed-off-by: Rishabh Maurya <[email protected]> * Fix bugs Signed-off-by: Rishabh Maurya <[email protected]> * Added mapper tests, stil failing on prefix and phrase tests Signed-off-by: Rishabh Maurya <[email protected]> * Disable index prefix and phrase mapper Signed-off-by: Rishabh Maurya <[email protected]> * Added unit tests for phrase and multiphrase query validation Signed-off-by: Rishabh Maurya <[email protected]> * Add unit tests for prefix and prefix phrase queries Signed-off-by: Rishabh Maurya <[email protected]> * Add a test to cover 3 word with synonym match phrase prefix query Signed-off-by: Rishabh Maurya <[email protected]> * Add unit test for SourceFieldMatchQuery Signed-off-by: Rishabh Maurya <[email protected]> * Added test for _source disabled case Signed-off-by: Rishabh Maurya <[email protected]> * Add unit test for missing field Signed-off-by: Rishabh Maurya <[email protected]> * more validation tests and changelog update Signed-off-by: Rishabh Maurya <[email protected]> * Added integration tests for match_only_text replicating text field integ tests Signed-off-by: Rishabh Maurya <[email protected]> * Added skip section in integ test to fix mixed cluster failures Signed-off-by: Rishabh Maurya <[email protected]> * remove unused import Signed-off-by: Rishabh Maurya <[email protected]> * Address PR comments Signed-off-by: Rishabh Maurya <[email protected]> * fix integ tests Signed-off-by: Rishabh Maurya <[email protected]> * Fix flaky test due to random indexwriter Signed-off-by: Rishabh Maurya <[email protected]> * pr comment: header modification Signed-off-by: Rishabh Maurya <[email protected]> * Address PR comments Signed-off-by: Rishabh Maurya <[email protected]> * addded change to the right section of CHANGELOG Signed-off-by: Rishabh Maurya <[email protected]> * overriding the textFieldType before every test Signed-off-by: Rishabh Maurya <[email protected]> * rename @before method Signed-off-by: Rishabh Maurya <[email protected]> * update changelog description Signed-off-by: Rishabh Maurya <[email protected]> --------- Signed-off-by: Rishabh Maurya <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
index_options
fixed todocs
, norms disabled to optimize on storage.Features not supported -
_source
field will disable any positional query support (Note: instead of not allowing disabling_source
field, I have decided to throw exceptions when positional queries would be executed for users who don't have use case of positional queries and want to save on space).docs
isn't allowed.Best used for -
Migration from text field
reindex api can be used to migrate the index from
text
tomatch_only_text
field and viceversa.Implementation breakdown -
MatchOnlyTextFieldMapper
which extendsTextFieldMapper
with few constraints and different defaultsFieldType
forMatchOnlyTextFieldMapper
which adds constraints specific to match_only_text field and supports positional queries by reading value of the match_only_text field from the_source
field.SourceFieldMatchQuery
- query which accepts a delegate query, to apply various filters to prune the resultset, and a source filter query. It loads the_source
for each hit from result of delegate query, creates a single doc LuceneMemoryIndex
for each hit and runs source filter query against it. It usesConstantScoreWeight
to disable scoring.Testing done
SourceFieldMatchQuery
created by theMatchOnlyTextFieldMapper
. It also validates various unsupported cases.SourceFieldMatchQuery
- it create a Lucene index and tries to check possible scenarios for SourceFieldMatchQuery like -text
withmatch_only_text
field. Overridden the expected behavior wherever necessary.TODOs
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
#6836
opensearch-project/documentation-website#5427
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.