Skip to content
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

added highlight to search endpoint whitelist #171

Closed
wants to merge 1 commit into from

Conversation

prattcmp
Copy link

@prattcmp prattcmp commented Dec 3, 2023

Description

It fixes the whitelist for the search endpoint by adding "highlight". Maintainers should highly consider removing whitelist or making it optional.

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

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.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test and CHANGELOG, please, however trivial the implementation.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9ebb183) 24.19% compared to head (8054d23) 24.19%.

Files Patch % Lines
src/OpenSearch/Endpoints/Search.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #171      +/-   ##
============================================
- Coverage     24.19%   24.19%   -0.01%     
  Complexity     1938     1938              
============================================
  Files           246      246              
  Lines          6865     6866       +1     
============================================
  Hits           1661     1661              
- Misses         5204     5205       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dblock
Copy link
Member

dblock commented Apr 18, 2024

@prattcmp Want to finish this?

@@ -78,7 +78,8 @@ public function getParamWhitelist(): array
'batched_reduce_size',
'max_concurrent_shard_requests',
'pre_filter_shard_size',
'rest_total_hits_as_int'
'rest_total_hits_as_int',
'highlight'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @prattcmp, it looks like highlight isn't a valid parameter for the Search API. I tested it. Search doesn't include the highlight parameter here.

If you think there's something missing, feel free to contribute! You can also consider contributing to the opensearch API specification here and adding any missing parameters. Thanks!

@saimedhi saimedhi closed this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants