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

[DOCS] Added the documentation for ELASTIC_CLIENT_URL_PLUS_AS_SPACE settings #1311

Merged
merged 5 commits into from
Apr 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/connecting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,30 @@ latest 7.x client and set the environment variable `ELASTIC_CLIENT_APIVERSIONING
to `true`. The client is handling the rest internally. For every 8.0 and beyond
client, you're all set! The compatibility mode is enabled by default.

[discrete]
[[space-encode-url]]
=== Space encode in URL

If you use a space character in an index name, elasticsearch-php will convert it into
a `+`, since this space must be encoded in a URL. The same applies for `id` and `type`
parameters.
ezimuel marked this conversation as resolved.
Show resolved Hide resolved

Starting from Elasticsearch 7.4, a `+` in URL will be encoded as `%2B` by all the REST
ezimuel marked this conversation as resolved.
Show resolved Hide resolved
API functionality. Prior versions handled a `+` as a single space. If your
application requires handling `+` as a single space you can return to the old
behaviour by setting the Elasticsearch system property `es.rest.url_plus_as_space` to `true`.
You can read the https://www.elastic.co/guide/en/elasticsearch/reference/7.17/breaking-changes-7.4.html#_changes_to_encoding_plus_signs_in_urls[Elasticsearch release note]
for mote information.

Starting from elasticsearch-php 7.17.2 we introduced an environmental variable `ELASTIC_CLIENT_URL_PLUS_AS_SPACE`
ezimuel marked this conversation as resolved.
Show resolved Hide resolved
that can be used to encode a space using `+`, setting the variable to `true`.
If `ELASTIC_CLIENT_URL_PLUS_AS_SPACE` is set to `false` a space will be encoded using `%20`
ezimuel marked this conversation as resolved.
Show resolved Hide resolved
as specified in https://www.rfc-editor.org/rfc/rfc3986[RFC 3986].

For instance, if you are using a space character in an index name, this will be
encoded using a `+`, default behaviour. If you set `ELASTIC_CLIENT_URL_PLUS_AS_SPACE`
to `false` the space in the index name will be encoded with `%20`.


[discrete]
[[client-usage]]
Expand Down