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 paginationDepth to HybridQuery #848

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -69,6 +69,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `optional_extended_plugins` field to `PluginStats` ([#814](https://github.com/opensearch-project/opensearch-api-specification/pull/814))
- Added `id` & `group_by` fields to `TopQuery` ([#814](https://github.com/opensearch-project/opensearch-api-specification/pull/814))
- Added `normalizer` to `WildcardProperty` ([#847](https://github.com/opensearch-project/opensearch-api-specification/pull/847))
- Added `paginationDepth` to `HybridQuery` ([#848](https://github.com/opensearch-project/opensearch-api-specification/pull/848))

### Removed
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
Expand Down
3 changes: 3 additions & 0 deletions spec/schemas/_common.query_dsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ components:
type: array
items:
$ref: '#/components/schemas/QueryContainer'
pagination_depth:
type: integer
format: int32
IdsQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
Expand Down
60 changes: 60 additions & 0 deletions tests/default/_core/search/hybrid_query_pagination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test hybrid query with pagination_depth property.
version: '>=2.19'
prologues:
- path: /books
method: PUT
request:
payload:
mappings:
properties:
title:
type: text
fields:
keyword:
type: keyword
author:
type: text
year:
type: integer

- path: /_bulk
method: POST
parameters:
refresh: true
request:
content_type: application/x-ndjson
payload:
- {index: {_index: books, _id: book1}}
- {title: To Kill a Mockingbird, author: Harper Lee, year: 1960}
- {index: {_index: books, _id: book2}}
- {title: '1984', author: George Orwell, year: 1949}
- {index: {_index: books, _id: book3}}
- {title: The Great Gatsby, author: F. Scott Fitzgerald, year: 1925}
epilogues:
- path: /books
method: DELETE
status: [200, 404]
chapters:
- synopsis: Search with hybrid query including pagination_depth property.
path: /{index}/_search
method: POST
parameters:
index: books
request:
payload:
query:
hybrid:
queries:
- match:
title: Kill
- match:
title: Gatsby
pagination_depth: 10
response:
status: 200
payload:
hits:
total:
relation: eq
Loading