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

guides: update the snippets according to the doc review #4412

Merged
merged 4 commits into from
Jan 29, 2025
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ jobs:
path: clients-javascript.zip

client_gen:
timeout-minutes: 15
timeout-minutes: 20 # swift CTS is excruciatingly slow
runs-on: ubuntu-22.04
needs:
- setup
Expand Down Expand Up @@ -381,12 +381,13 @@ jobs:
run: yarn cli cts generate ${{ matrix.client.language }} ${{ matrix.client.toRun }} --language-version ${{ matrix.client.version }}

- name: Run unit CTS
if: ${{ matrix.client.language != 'swift' || startsWith(github.head_ref, 'chore/prepare-release-') }}
run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-e2e

- name: Run e2e CTS
id: cts-e2e
continue-on-error: true
if: ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
if: ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && (matrix.client.language != 'swift' || startsWith(github.head_ref, 'chore/prepare-release-')) }}
run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests

- name: Retry e2e CTS
Expand Down
18 changes: 18 additions & 0 deletions tests/CTS/requests/search/searchSingleIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,24 @@
}
}
},
{
"testName": "api_filtering_range_example",
"parameters": {
"indexName": "indexName",
"searchParams": {
"query": "books",
"filters": "price:10 TO 20"
}
},
"request": {
"path": "/1/indexes/indexName/query",
"method": "POST",
"body": {
"query": "books",
"filters": "price:10 TO 20"
}
}
},
{
"testName": "search_a_query",
"parameters": {
Expand Down
86 changes: 86 additions & 0 deletions tests/CTS/requests/search/setSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,72 @@
}
}
},
{
"testName": "api_attributes_for_faceting",
"parameters": {
"indexName": "<YOUR_INDEX_NAME>",
"indexSettings": {
"attributesForFaceting": [
"genre",
"author"
]
}
},
"request": {
"path": "/1/indexes/%3CYOUR_INDEX_NAME%3E/settings",
"method": "PUT",
"body": {
"attributesForFaceting": [
"genre",
"author"
]
}
}
},
{
"testName": "api_attributes_for_faceting_searchable",
"parameters": {
"indexName": "<YOUR_INDEX_NAME>",
"indexSettings": {
"attributesForFaceting": [
"genre",
"searchable(author)"
]
}
},
"request": {
"path": "/1/indexes/%3CYOUR_INDEX_NAME%3E/settings",
"method": "PUT",
"body": {
"attributesForFaceting": [
"genre",
"searchable(author)"
]
}
}
},
{
"testName": "api_attributes_for_filter_only",
"parameters": {
"indexName": "<YOUR_INDEX_NAME>",
"indexSettings": {
"attributesForFaceting": [
"filterOnly(genre)",
"author"
]
}
},
"request": {
"path": "/1/indexes/%3CYOUR_INDEX_NAME%3E/settings",
"method": "PUT",
"body": {
"attributesForFaceting": [
"filterOnly(genre)",
"author"
]
}
}
},
{
"testName": "attributesForFaceting categoryPageId",
"parameters": {
Expand Down Expand Up @@ -788,6 +854,26 @@
}
}
},
{
"testName": "create replica index articles",
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
"replicas": [
"articles_date_desc"
]
}
},
"request": {
"path": "/1/indexes/theIndexName/settings",
"method": "PUT",
"body": {
"replicas": [
"articles_date_desc"
]
}
}
},
{
"testName": "create virtual replica index",
"parameters": {
Expand Down