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

Python code hangs - needs the 'aSampleMasterKey' API key #2499

Closed
RGGH opened this issue Jun 30, 2023 · 7 comments
Closed

Python code hangs - needs the 'aSampleMasterKey' API key #2499

RGGH opened this issue Jun 30, 2023 · 7 comments
Assignees

Comments

@RGGH
Copy link

RGGH commented Jun 30, 2023

https://www.meilisearch.com/docs/learn/getting_started/quick_start

The Python script never completes with the copy/paste code, might confuse beginners!

should read:

client = meilisearch.Client('http://127.0.0.1:7700', 'aSampleMasterKey')

not client = meilisearch.Client('http://localhost:7700')

@guimachiavelli
Copy link
Member

Hi @RGGH! Thanks for creating this issue!

@meilisearch/integration-team, what do you think? None of the Quick start SDK samples use aSampleMasterKey, which means SDK users following this tutorial might stumble on the same problem.

@brunoocasali
Copy link
Member

@alallema does the python SDK allow starting the client with no master key?

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Jul 3, 2023

I think every SDK's code-sample should be updated to add aSimpleMasterKey to it client instantiation

This is the curl code-sample

curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary @movies.json

These is the JS for example:

const client = new MeiliSearch({ host: 'http://localhost:7700' })
client.index('movies').addDocuments(movies)
  .then((res) => console.log(res))

From those I checked, none of the languages include that apiKey in their getting started code-samples.

@brunoocasali
Copy link
Member

I don't get it sorry :/ We support the integrations to be instantiated without a key, like meilisearch itself. If this is not a bug on the Python side, why should we update the code samples?

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Jul 3, 2023

In the flow of the quickstart guide, during the launch step, we ask the user to add a masterKey

Screenshot 2023-07-03 at 19 11 15

When arriving in the add documents sections, if you copy paste the cURL sample it works as it contains the master key, but any other SDK sample wont work as they don't contain it.

See screen with python, but it's the same for all other languages except cURL
Screenshot 2023-07-03 at 19 12 29

meili-bors bot added a commit to meilisearch/meilisearch-php that referenced this issue Jul 3, 2023
537: Update getting_started code-samples r=brunoocasali a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
meili-bors bot added a commit to meilisearch/meilisearch-js that referenced this issue Jul 4, 2023
1529: Update getting_started code-samples r=bidoubiwa a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
meili-bors bot added a commit to meilisearch/meilisearch-js that referenced this issue Jul 4, 2023
1529: Update getting_started code-samples r=bidoubiwa a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
meili-bors bot added a commit to meilisearch/meilisearch-rust that referenced this issue Jul 4, 2023
490: Update getting_started code-samples r=bidoubiwa a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
@alallema
Copy link
Contributor

alallema commented Jul 4, 2023

@alallema does the python SDK allow starting the client with no master key?

Yes, like almost SDK I think.

If this is not a bug on the Python side, why should we update the code samples?

Perfect!

meili-bors bot added a commit to meilisearch/meilisearch-python that referenced this issue Jul 4, 2023
792: Update getting_started code-samples r=alallema a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
meili-bors bot added a commit to meilisearch/meilisearch-dart that referenced this issue Jul 4, 2023
328: Update getting_started code-samples r=brunoocasali a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Ahmed Fwela <63286031+ahmednfwela@users.noreply.github.com>
meili-bors bot added a commit to meilisearch/meilisearch-rust that referenced this issue Jul 6, 2023
490: Update getting_started code-samples r=bidoubiwa a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
meili-bors bot added a commit to meilisearch/meilisearch-java that referenced this issue Jul 11, 2023
619: Update getting_started code-samples r=alallema a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
meili-bors bot added a commit to meilisearch/meilisearch-go that referenced this issue Jul 11, 2023
450: Update getting_started code-samples r=alallema a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
meili-bors bot added a commit to meilisearch/meilisearch-dotnet that referenced this issue Jul 11, 2023
441: Update getting_started code-samples r=alallema a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
meili-bors bot added a commit to meilisearch/meilisearch-ruby that referenced this issue Jul 11, 2023
451: Update getting_started code-samples r=brunoocasali a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
meili-bors bot added a commit to meilisearch/meilisearch-swift that referenced this issue Jul 12, 2023
390: Update getting_started code-samples r=brunoocasali a=meili-bot

_This PR is auto-generated._
Update the code-samples.meilisearch.yml according to the [documentation issue](meilisearch/documentation#2499). 
The `api_key` field is missing in the instantiation of the client in the getting started samples.
Add `aSampleMasterKey` as the `api_key`.
cURL example:
```bash
    curl \
  -X POST 'http://localhost:7700/indexes/movies/documents?primaryKey=id' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer aSampleMasterKey' \
  --data-binary `@movies.json`
````


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
@brunoocasali
Copy link
Member

brunoocasali commented Jul 12, 2023

All the PRs were closed, so no more missing keys in the quickstart guide. @guimachiavelli I'll close this, but I think we need to trigger a new docs version to see it in production :)

Thanks @bidoubiwa and @RGGH for the report 🎉

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

No branches or pull requests

5 participants