Skip to content

Commit

Permalink
replace localhost:7700 in code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
guimachiavelli committed Dec 19, 2024
1 parent 1b5d0ab commit 021a11b
Show file tree
Hide file tree
Showing 19 changed files with 236 additions and 248 deletions.
404 changes: 202 additions & 202 deletions .code-samples.meilisearch.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions guides/computing_hugging_face_embeddings_gpu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Next, enable the vector store experimental feature:

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{ "vectorStore": true }'
```
Expand All @@ -68,7 +68,7 @@ Then add the Hugging Face embedder to your index settings:

```sh
curl \
-X PATCH 'http://localhost:7700/indexes/INDEX_NAME/settings/embedders' \
-X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/embedders' \
-H 'Content-Type: application/json' \
--data-binary '{ "default": { "source": "huggingFace" } }'
```
Expand Down
26 changes: 7 additions & 19 deletions guides/front_end/search_bar_for_docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,15 @@ This tutorial will guide you through the steps of building a relevant and powerf

## Run a Meilisearch instance

First of all, you need your documentation content to be scraped and pushed into a Meilisearch instance.

You can install and run Meilisearch on your machine using `curl`.

```bash
curl -L https://install.meilisearch.com | sh
./meilisearch --master-key=MASTER_KEY
```

We provide a few [other installation methods](/learn/self_hosted/getting_started_with_self_hosted_meilisearch#setup-and-installation).

Meilisearch is open-source and can run either on your server or on any cloud provider.
First, create a new Meilisearch project on Meilisearch Cloud. You can also [install and run Meilisearch locally or in another cloud service](/learn/self_hosted/getting_started_with_self_hosted_meilisearch#setup-and-installation).

<Capsule intent="note">

The host URL and the API key you will provide in the next steps correspond to the credentials of this Meilisearch instance.
In the example above, the host URL is `http://localhost:7700` and the API key is `MASTER_KEY`.

</Capsule>

## Scrape your content

The Meili team provides and maintains a [scraper tool](https://github.com/meilisearch/docs-scraper) to automatically read the content of your website and store it into an index in Meilisearch.
The Meilisearch team provides and maintains a [scraper tool](https://github.com/meilisearch/docs-scraper) to automatically read the content of your website and store it into an index in Meilisearch.

### Configuration file

Expand Down Expand Up @@ -98,7 +84,7 @@ You can run the scraper with Docker. With our local Meilisearch instance set up
```bash
docker run -t --rm \
--network=host \
-e MEILISEARCH_HOST_URL='http://localhost:7700' \
-e MEILISEARCH_HOST_URL='MEILISEARCH_URL' \
-e MEILISEARCH_API_KEY='MASTER_KEY' \
-v <absolute-path-to-your-config-file>:/docs-scraper/config.json \
getmeili/docs-scraper:latest pipenv run ./docs_scraper config.json
Expand Down Expand Up @@ -166,7 +152,8 @@ module.exports = {
}
```

The `hostUrl` and the `apiKey` fields are the credentials of the Meilisearch instance. Following on from this tutorial, they are respectively `http://localhost:7700` and `MASTER_KEY`.
The `hostUrl` and the `apiKey` fields are the credentials of the Meilisearch instance. Following on from this tutorial, they are respectively `MEILISEARCH_URL` and `MASTER_KEY`.

`indexUid` is the index identifier in your Meilisearch instance in which your website content is stored. It has been defined in the [config file](#configuration-file).

These three fields are mandatory, but more [optional fields are available](https://github.com/meilisearch/vuepress-plugin-meilisearch#customization) to customize your search bar.
Expand Down Expand Up @@ -208,7 +195,8 @@ _[Docxtemplater](https://docxtemplater.com/) search bar demo_
</html>
```

The `hostUrl` and the `apiKey` fields are the credentials of the Meilisearch instance. Following on from this tutorial, they are respectively `http://localhost:7700` and `MASTER_KEY`.
The `hostUrl` and the `apiKey` fields are the credentials of the Meilisearch instance. Following on from this tutorial, they are respectively `MEILISEARCH_URL` and `MASTER_KEY`.

`indexUid` is the index identifier in your Meilisearch instance in which your website content is stored. It has been defined in the [config file](#configuration-file).
`inputSelector` is the `id` attribute of the HTML search input tag.

Expand Down
2 changes: 1 addition & 1 deletion guides/improve_relevancy_large_documents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ To prevent that from happening, configure `story_id` as the index's distinct att

```sh
curl \
-X PUT 'http://localhost:7700/indexes/INDEX_NAME/settings/distinct-attribute' \
-X PUT 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/distinct-attribute' \
-H 'Content-Type: application/json' \
--data-binary '"story_id"'
```
Expand Down
2 changes: 1 addition & 1 deletion learn/ai_powered_search/deactivate_ai_powered_search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Alternatively, use [the `/experimental` route](/reference/api/experimental_featu

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"vectorStore": false
Expand Down
6 changes: 3 additions & 3 deletions learn/ai_powered_search/getting_started_with_ai_search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Use [the `/experimental-features` route](/reference/api/experimental_features?ut

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"vectorStore": true
Expand All @@ -54,7 +54,7 @@ Use the `embedders` index setting of the [update `/settings` endpoint](/referenc

```sh
curl \
-X PATCH 'http://localhost:7700/indexes/kitchenware/settings' \
-X PATCH 'MEILISEARCH_URL/indexes/kitchenware/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"embedders": {
Expand Down Expand Up @@ -86,7 +86,7 @@ Perform AI-powered searches with `q` and `hybrid` to retrieve search results usi

```sh
curl \
-X POST 'http://localhost:7700/indexes/kitchenware/search' \
-X POST 'MEILISEARCH_URL/indexes/kitchenware/search' \
-H 'content-type: application/json' \
--data-binary '{
"q": "kitchen utensils made of wood",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Configure the `embedder` index setting, settings its source to `userProvided`:

```sh
curl \
-X PATCH 'http://localhost:7700/indexes/movies/settings' \
-X PATCH 'MEILISEARCH_URL/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"embedders": {
Expand Down
2 changes: 1 addition & 1 deletion learn/async/task_webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A common asynchronous operation is adding or updating documents to an index. The

```sh
curl \
-X POST 'http://localhost:7700/indexes/books/documents' \
-X POST 'MEILISEARCH_URL/indexes/books/documents' \
-H 'Content-Type: application/json' \
--data-binary '[
{
Expand Down
2 changes: 1 addition & 1 deletion learn/engine/datatypes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ The following query returns patients `0` and `1`:

```sh
curl \
-X POST 'http://localhost:7700/indexes/clinic_patients/search' \
-X POST 'MEILISEARCH_URL/indexes/clinic_patients/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "",
Expand Down
4 changes: 2 additions & 2 deletions learn/filtering_and_sorting/filter_expression_reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ This is an experimental feature. Use the experimental features endpoint to activ

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"containsFilter": true
Expand Down Expand Up @@ -211,7 +211,7 @@ This is an experimental feature. Use the experimental features endpoint to activ

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"containsFilter": true
Expand Down
10 changes: 5 additions & 5 deletions learn/multi_search/performing_federated_search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Download the following datasets: <a href="/assets/datasets/crm-chats.json">`crm-
Add the datasets to Meilisearch and create three separate indexes, `profiles`, `chats`, and `tickets`:

```sh
curl -X POST 'http://localhost:7700/indexes/profiles' -H 'Content-Type: application/json' --data-binary @crm-profiles.json &&
curl -X POST 'http://localhost:7700/indexes/chats' -H 'Content-Type: application/json' --data-binary @crm-chats.json &&
curl -X POST 'http://localhost:7700/indexes/tickets' -H 'Content-Type: application/json' --data-binary @crm-tickets.json
curl -X POST 'MEILISEARCH_URL/indexes/profiles' -H 'Content-Type: application/json' --data-binary @crm-profiles.json &&
curl -X POST 'MEILISEARCH_URL/indexes/chats' -H 'Content-Type: application/json' --data-binary @crm-chats.json &&
curl -X POST 'MEILISEARCH_URL/indexes/tickets' -H 'Content-Type: application/json' --data-binary @crm-tickets.json
```

[Use the tasks endpoint](/learn/async/working_with_tasks) to check the indexing status. Once Meilisearch successfully indexed all three datasets, you are ready to perform a federated search.
Expand All @@ -36,7 +36,7 @@ Use the `/multi-search` endpoint with the `federation` parameter to query the th

```sh
curl \
-X POST 'http://localhost:7700/multi-search' \
-X POST 'MEILISEARCH_URL/multi-search' \
-H 'Content-Type: application/json' \
--data-binary '{
"federation": {},
Expand Down Expand Up @@ -90,7 +90,7 @@ Use the `weight` property of the `federation` parameter to boost results coming

```sh
curl \
-X POST 'http://localhost:7700/multi-search' \
-X POST 'MEILISEARCH_URL/multi-search' \
-H 'Content-Type: application/json' \
--data-binary '{
"federation": {},
Expand Down
2 changes: 1 addition & 1 deletion learn/security/generate_tenant_token_scratch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Next, find your default search API key. Query the [get an API key endpoint](/ref

```sh
curl \
-X GET 'http://localhost:7700/keys/API_KEY' \
-X GET 'MEILISEARCH_URL/keys/API_KEY' \
-H 'Authorization: Bearer MASTER_KEY'
```

Expand Down
2 changes: 1 addition & 1 deletion learn/security/generate_tenant_token_sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Next, find your default search API key. Query the [get an API key endpoint](/ref

```sh
curl \
-X GET 'http://localhost:7700/keys/API_KEY' \
-X GET 'MEILISEARCH_URL/keys/API_KEY' \
-H 'Authorization: Bearer MASTER_KEY'
```

Expand Down
2 changes: 1 addition & 1 deletion learn/security/generate_tenant_token_third_party.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Next, find your default search API key. Query the [get an API key endpoint](/ref

```sh
curl \
-X GET 'http://localhost:7700/keys/API_KEY' \
-X GET 'MEILISEARCH_URL/keys/API_KEY' \
-H 'Authorization: Bearer MASTER_KEY'
```

Expand Down
4 changes: 2 additions & 2 deletions reference/api/documents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ This is an experimental feature. Use the experimental features endpoint to activ

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"editDocumentsByFunction": true
Expand Down Expand Up @@ -439,7 +439,7 @@ Use `context` to pass data to the `function` scope. By default a function only h

```sh
curl \
-X POST 'http://localhost:7700/indexes/INDEX_NAME/documents/edit' \
-X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/documents/edit' \
-H 'Content-Type: application/json' \
--data-binary '{
"function": "doc.title = `${doc.title.to_upper()}`"
Expand Down
2 changes: 1 addition & 1 deletion reference/api/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is an experimental feature. Use the experimental features endpoint to activ

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"logsRoute": true
Expand Down
2 changes: 1 addition & 1 deletion reference/api/metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This is an experimental feature. Use the experimental features endpoint to activ

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-X PATCH 'MEILISEARCH_URL/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"enableMetrics": true
Expand Down
4 changes: 2 additions & 2 deletions reference/api/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ Meilisearch supports the following compression methods:
The code sample below uses the `Content-Encoding: gzip` header, indicating that the request body is compressed using the `gzip` algorithm:

```
cat ~/movies.json | gzip | curl -X POST 'http://localhost:7700/indexes/movies/documents' --data-binary @- -H 'Content-Type: application/json' -H 'Content-Encoding: gzip'
cat ~/movies.json | gzip | curl -X POST 'MEILISEARCH_URL/indexes/movies/documents' --data-binary @- -H 'Content-Type: application/json' -H 'Content-Encoding: gzip'
```

#### Response compression

Meilisearch compresses a response if the request contains the `Accept-Encoding` header. The code sample below uses the `gzip` algorithm:

```
curl -sH 'Accept-encoding: gzip' 'http://localhost:7700/indexes/movies/search' | gzip -
curl -sH 'Accept-encoding: gzip' 'MEILISEARCH_URL/indexes/movies/search' | gzip -
```

## Request body
Expand Down
2 changes: 1 addition & 1 deletion reference/api/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,7 @@ Use `distribution` when configuring an embedder to correct the returned `_rankin

```sh
curl \
-X PATCH 'http://localhost:7700/indexes/INDEX_NAME/settings' \
-X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"embedders": {
Expand Down

0 comments on commit 021a11b

Please sign in to comment.