Skip to content

Commit

Permalink
Merge #875
Browse files Browse the repository at this point in the history
875: Changes related to the next MeiliSearch release (v0.21.0) r=bidoubiwa a=meili-bot

Related to this issue: meilisearch/integration-guides#117

This PR:
- gathers the changes related to the next MeiliSearch release (v0.21.0) so that this package is ready when the official release is out.
- should pass the tests against the [latest pre-release of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases). Until there is an RC version, the tests should be valid against the [alpha versions of transplant](https://github.com/meilisearch/transplant/releases).
- might eventually contain test failures until the MeiliSearch v0.21.0 is out.

⚠️ This PR should NOT be merged until the next release of MeiliSearch (v0.21.0) is out.

_This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose. Exceptionally for this release, the pre-release time will be more than just one week._


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: Charlotte Vermandel <charlottevermandel@gmail.com>
Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
  • Loading branch information
5 people authored Aug 24, 2021
2 parents 18100a9 + ca718eb commit 355edeb
Show file tree
Hide file tree
Showing 19 changed files with 1,452 additions and 1,038 deletions.
60 changes: 29 additions & 31 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ delete_documents_1: |-
search_post_1: |-
client.index('movies').search('American ninja')
search_get_1: |-
client.index('movies').search('American ninja', {}, 'GET')
client.index('movies').search('American ninja')
get_update_1: |-
client.index('movies').getUpdateStatus(1)
get_all_updates_1: |-
Expand All @@ -52,11 +52,10 @@ get_settings_1: |-
update_settings_1: |-
client.index('movies').updateSettings({
rankingRules: [
'typo',
'words',
'typo',
'proximity',
'attribute',
'wordsPosition',
'exactness',
'desc(release_date)',
'desc(rank)'
Expand Down Expand Up @@ -105,11 +104,10 @@ get_ranking_rules_1: |-
client.index('movies').getRankingRules()
update_ranking_rules_1: |-
client.index('movies').updateRankingRules([
'typo',
'words',
'typo',
'proximity',
'attribute',
'wordsPosition',
'exactness',
'asc(release_date)',
'desc(rank)'
Expand Down Expand Up @@ -172,19 +170,19 @@ field_properties_guide_displayed_1: |-
})
filtering_guide_1: |-
client.index('movies').search('Avengers', {
filters: 'release_date > 795484800'
filter: 'release_date > 795484800'
})
filtering_guide_2: |-
client.index('movies').search('Batman', {
filters: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
filter: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
})
filtering_guide_3: |-
client.index('movies').search('horror', {
filters: 'director = "Jordan Peele"'
filter: 'director = "Jordan Peele"'
})
filtering_guide_4: |-
client.index('movies').search('Planet of the Apes', {
filters: 'rating >= 3 AND (NOT director = "Tim Burton")'
filter: 'rating >= 3 AND (NOT director = "Tim Burton")'
})
search_parameter_guide_query_1: |-
client.index('movies').search('shifu')
Expand All @@ -206,21 +204,19 @@ search_parameter_guide_crop_1: |-
cropLength: 10
})
search_parameter_guide_highlight_1: |-
client.index('movies').search('shifu', {
client.index('movies').search('winter feast', {
attributesToHighlight: ['overview']
})
search_parameter_guide_filter_1: |-
client.index('movies').search('n', {
filters: 'title = Nightshift'
filter: 'title = Nightshift'
})
search_parameter_guide_filter_2: |-
client.index('movies').search('n', {
filters: 'title="Kung Fu Panda"'
filter: 'title="Kung Fu Panda"'
})
search_parameter_guide_matches_1: |-
client.index('movies').search('n', {
filters: 'title="Kung Fu Panda"',
attributesToHighlight: ['overview'],
client.index('movies').search('winter feast', {
matches: true
})
settings_guide_synonyms_1: |-
Expand All @@ -240,11 +236,10 @@ settings_guide_stop_words_1: |-
settings_guide_ranking_rules_1: |-
client.index('movies').updateSettings({
rankingRules: [
'typo',
'words',
'typo',
'proximity',
'attribute',
'wordsPosition',
'exactness',
'asc(release_date)',
'desc(rank)'
Expand Down Expand Up @@ -286,7 +281,7 @@ search_guide_1: |-
})
search_guide_2: |-
client.index('movies').search('Avengers', {
filters: 'release_date > 795484800',
filter: 'release_date > 795484800',
})
getting_started_add_documents_md: |-
```bash
Expand Down Expand Up @@ -326,44 +321,44 @@ getting_started_search_md: |-
```
[About this SDK](https://github.com/meilisearch/meilisearch-js/)
get_attributes_for_faceting_1: |-
client.index('movies').getAttributesForFaceting()
update_attributes_for_faceting_1: |-
get_filterable_attributes_1: |-
client.index('movies').getFilterableAttributes()
update_filterable_attributes_1: |-
client.index('movies')
.updateAttributesForFaceting([
.updateFilterableAttributes([
'genres',
'director'
])
reset_attributes_for_faceting_1: |-
client.index('movies').resetAttributesForFaceting()
reset_filterable_attributes_1: |-
client.index('movies').resetFilterableAttributes()
faceted_search_update_settings_1: |-
client.index('movies')
.updateAttributesForFaceting([
.updateFilterableAttributes([
'director',
'genres'
])
faceted_search_facet_filters_1: |-
faceted_search_filter_1: |-
client.index('movies')
.search('thriller', {
facetFilters: [['genres:Horror', 'genres:Mystery'], 'director:Jordan Peele']
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
})
faceted_search_facets_distribution_1: |-
client.index('movies')
.search('Batman', {
facetsDistribution: ['genres']
})
faceted_search_walkthrough_attributes_for_faceting_1: |-
faceted_search_walkthrough_filterable_attributes_1: |-
client.index('movies')
.updateAttributesForFaceting([
.updateFilterableAttributes([
'director',
'producer',
'genres',
'production_companies'
])
faceted_search_walkthrough_facet_filters_1: |-
faceted_search_walkthrough_filter_1: |-
client.index('movies')
.search('thriller', {
facetFilters: [['genres:Horror', 'genres:Mystery'], 'director:Jordan Peele']
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
})
faceted_search_walkthrough_facets_distribution_1: |-
client.index('movies')
Expand All @@ -374,3 +369,6 @@ post_dump_1: |-
client.createDump()
get_dump_status_1: |-
client.getDumpStatus("20201101-110357260")
phrase_search_1: |-
client.index('movies')
.search('"african american" horror')
2 changes: 1 addition & 1 deletion .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '10', '12', '14' ]
node: [ '12', '14' ]
name: integration-tests-against-rc (Node.js ${{ matrix.node }})
steps:
- uses: actions/checkout@v2
Expand Down
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ import { MeiliSearch } from 'meilisearch'
})()
```

With the `updateId`, you can check the status (`enqueued`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
With the `updateId`, you can check the status (`enqueued`, `processing`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).

#### Basic Search <!-- omit in toc -->

Expand Down Expand Up @@ -202,9 +202,8 @@ All the supported options are described in the [search parameters](https://docs.
```javascript
await index.search(
'wonder',
{
attributesToHighlight: ['*'],
filters: 'id >= 1'
filter: 'id >= 1'
}
)
```
Expand Down Expand Up @@ -239,7 +238,7 @@ Placeholder search makes it possible to receive hits based on your parameters wi
await index.search(
'',
{
facetFilters: ['genres:fantasy'],
filter: ['genres = fantasy'],
facetsDistribution: ['genres']
}
)
Expand All @@ -266,11 +265,8 @@ await index.search(
"query": "",
"facetsDistribution": {
"genres": {
"Drama": 0,
"Action": 2,
"Science Fiction": 0,
"Fantasy": 1,
"Romance": 0,
"Adventure": 1
}
}
Expand All @@ -284,7 +280,7 @@ You can abort a pending search request by providing an [AbortSignal](https://dev
const controller = new AbortController()

index
.search('wonder', {}, 'POST', {
.search('wonder', {}, {
signal: controller.signal,
})
.then((response) => {
Expand All @@ -299,7 +295,7 @@ controller.abort()

## 🤖 Compatibility with MeiliSearch

This package only guarantees the compatibility with the [version v0.20.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.20.0).
This package only guarantees the compatibility with the [version v0.21.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.21.0).

## 💡 Learn More

Expand All @@ -324,7 +320,11 @@ If you want to know more about the development workflow or want to contribute, p

- Make a search request:

`client.index<T>('xxx').search(query: string, options: SearchParams = {}, method: 'POST' | 'GET' = 'POST', config?: Partial<Request>): Promise<SearchResponse<T>>`
`client.index<T>('xxx').search(query: string, options: SearchParams = {}, config?: Partial<Request>): Promise<SearchResponse<T>>`

- Make a search request using GET method (slower than the search method):

`client.index<T>('xxx').searchGet(query: string, options: SearchParams = {}, config?: Partial<Request>): Promise<SearchResponse<T>>`

### Indexes <!-- omit in toc -->

Expand Down Expand Up @@ -443,7 +443,7 @@ Or using the index object:

- Update synonyms:

`index.updateSynonyms(synonyms: object): Promise<EnqueuedUpdate>`
`index.updateSynonyms(synonyms: Synonyms): Promise<EnqueuedUpdate>`

- Reset synonyms:

Expand All @@ -455,7 +455,7 @@ Or using the index object:
`index.getStopWords(): Promise<string[]>`

- Update Stop Words
`index.updateStopWords(string[]): Promise<EnqueuedUpdate>`
`index.updateStopWords(stopWords: string[] | null ): Promise<EnqueuedUpdate>`

- Reset Stop Words
`index.resetStopWords(): Promise<EnqueuedUpdate>`
Expand Down Expand Up @@ -504,6 +504,17 @@ Or using the index object:
- Reset Displayed Attributes
`index.resetDisplayedAttributes(): Promise<EnqueuedUpdate>`

### Filterable Attributes <!-- omit in toc -->

- Get Filterable Attributes
`index.getFilterableAttributes(): Promise<string[]>`

- Update Filterable Attributes
`index.updateFilterableAttributes(filterableAttributes: string[] | null): Promise<EnqueuedUpdate>`

- Reset Filterable Attributes
`index.resetFilterableAttributes(): Promise<EnqueuedUpdate>`

### Keys <!-- omit in toc -->

- Get keys
Expand Down
7 changes: 0 additions & 7 deletions playgrounds/javascript/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ const client = new MeiliSearch({
apiKey: 'masterKey',
})

async function sleep(ms) {
return await new Promise((resolve) => setTimeout(resolve, ms))
}

;(async () => {
// Delete if exist
try {
Expand All @@ -26,9 +22,6 @@ async function sleep(ms) {
const { updateId } = await index.addDocuments(dataset)
await index.waitForPendingUpdate(updateId)

// wait for
await sleep(1000)

// documents
const documents = await index.getDocuments()

Expand Down
Loading

0 comments on commit 355edeb

Please sign in to comment.