Skip to content

Commit

Permalink
feat(specs): add neuralSearch options (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Apr 19, 2023
1 parent e195668 commit 13e7d17
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/.cache_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.21
0.0.22
10 changes: 10 additions & 0 deletions specs/abtesting/paths/abtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ get:
parameters:
- $ref: '../../common/parameters.yml#/Offset'
- $ref: '../../common/parameters.yml#/Limit'
- name: indexPrefix
in: query
description: Filters the returned ab tests by any indices starting with the provided prefix that are assigned to either variant of an ab test.
schema:
type: string
- name: indexSuffix
in: query
description: Filters the returned ab tests by any indices ending with the provided suffix that are assigned to either variant of an ab test.
schema:
type: string
responses:
'200':
description: OK
Expand Down
31 changes: 31 additions & 0 deletions specs/common/schemas/IndexSettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,21 @@ indexSettingsAsSearchParams:
$ref: '#/queryType'
removeWordsIfNoResults:
$ref: '#/removeWordsIfNoResults'
mode:
$ref: '#/mode'
semanticSearch:
type: object
description: >
The settings relevant for configuration of the semantic search engine.
These settings are only used when the mode is set to 'neuralSearch'.
properties:
eventSources:
description: When null, the current index / replica group will be used as the event source.
nullable: true
type: array
items:
type: string

advancedSyntax:
type: boolean
description: Enables the advanced query syntax.
Expand Down Expand Up @@ -320,6 +335,14 @@ indexSettingsAsSearchParams:
default: [exactPhrase, excludeWords]
x-categories:
- Query strategy
explain:
type: array
items:
type: string
description: Enriches the API’s response with meta-information as to how the query was processed.
default: []
x-categories:
- Query strategy
distinct:
$ref: '#/distinct'
attributeForDistinct:
Expand Down Expand Up @@ -394,6 +417,14 @@ queryType:
x-categories:
- Query strategy

mode:
type: string
enum: ['neuralSearch', 'keywordSearch']
description: The search mode that the index will use to query for results.
default: keywordSearch
x-categories:
- Query strategy

removeWordsIfNoResults:
type: string
enum: [none, lastWords, firstWords, allOptional]
Expand Down
38 changes: 38 additions & 0 deletions specs/search/common/schemas/SearchResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ baseSearchResponse:
type: string
description: A url-encoded string of all search parameters.
example: query=a&hitsPerPage=20
redirect:
type: object
description: This parameter is for internal use only.
properties:
index:
type: array
items:
$ref: '#/RedirectRuleIndexMetadata'
parsedQuery:
type: string
description: The query string that will be searched, after normalization.
Expand Down Expand Up @@ -137,3 +145,33 @@ nbPages:
type: integer
description: Number of pages available for the current query.
example: 1

RedirectRuleIndexMetadata:
type: object
properties:
source:
type: string
description: Source index for the redirect rule.
dest:
type: string
description: Destination index for the redirect rule.
reason:
type: string
description: Reason for the redirect rule.
succeed:
type: boolean
description: Status for the redirect rule.
data:
type: object
description: Data for the redirect rule.
required:
- ruleObjectID
properties:
ruleObjectID:
type: string
required:
- data
- succeed
- reason
- dest
- source
8 changes: 6 additions & 2 deletions tests/CTS/methods/requests/abtesting/listABTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
"testName": "listABTests with parameters",
"parameters": {
"offset": 42,
"limit": 21
"limit": 21,
"indexPrefix": "foo",
"indexSuffix": "bar"
},
"request": {
"path": "/2/abtests",
"method": "GET",
"queryParameters": {
"offset": "42",
"limit": "21"
"limit": "21",
"indexPrefix": "foo",
"indexSuffix": "bar"
}
}
}
Expand Down

0 comments on commit 13e7d17

Please sign in to comment.