Add docs with up to date instructions on updating default similarity (#21242)

* Add docs with up to date instructions on updating default similarity

The default similarity can no longer be set in the configuration file
(you will get an error on startup). Update the docs with the method
that works.

* Add instructions for changing similarity on index creation
This commit is contained in:
Adriel Dean-Hall 2016-11-01 16:14:20 -04:00 committed by Nik Everett
parent 1f1daf59bc
commit b72a708c0d
1 changed files with 34 additions and 2 deletions

View File

@ -174,9 +174,41 @@ implementation used for these two methods, while not changing the
`default`, it is possible to configure a similarity with the name
`base`. This similarity will then be used for the two methods.
You can change the default similarity for all fields by putting the following setting into `elasticsearch.yml`:
You can change the default similarity for all fields in an index when
it is <<indices-create-index,created>>:
[source,js]
--------------------------------------------------
index.similarity.default.type: classic
PUT /my_index
{
"settings": {
"index": {
"similarity": {
"default": {
"type": "classic"
}
}
}
}
}
--------------------------------------------------
If you want to change the default similarity after creating the index
you must <<indices-open-close,close>> your index, send the follwing
request and <<indices-open-close,open>> it again afterwards:
[source,js]
--------------------------------------------------
PUT /my_index/_settings
{
"settings": {
"index": {
"similarity": {
"default": {
"type": "classic"
}
}
}
}
}
--------------------------------------------------