Browse Source

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
Adriel Dean-Hall 9 years ago
parent
commit
b72a708c0d
1 changed files with 34 additions and 2 deletions
  1. 34 2
      docs/reference/index-modules/similarity.asciidoc

+ 34 - 2
docs/reference/index-modules/similarity.asciidoc

@@ -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"
+        }
+      }
+    }
+  }
+}
 --------------------------------------------------