Prechádzať zdrojové kódy

[SPECS] Updated percolator specs.

Martijn van Groningen 11 rokov pred
rodič
commit
9bc3d996ff

+ 1 - 1
docs/reference/search/percolate.asciidoc

@@ -53,7 +53,7 @@ The above request will yield the following response:
         "successful" : 5,
         "failed" : 0
     },
-    "count" : 1,
+    "total" : 1,
     "matches" : [
     	{
     	     "_index" : "my-index",

+ 72 - 0
rest-api-spec/api/count_percolate.json

@@ -0,0 +1,72 @@
+{
+  "count_percolate": {
+    "documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html",
+    "methods": ["GET", "POST"],
+    "url": {
+      "path": "/{index}/{type}/_percolate/count",
+      "paths": ["/{index}/{type}/_percolate/count", "/{index}/{type}/{id}/_percolate/count"],
+      "parts": {
+        "index": {
+          "type": "string",
+          "required": true,
+          "description": "The index of the document being count percolated."
+        },
+        "type": {
+          "type": "string",
+          "required": true,
+          "description": "The type of the document being count percolated."
+        },
+        "id": {
+          "type": "string",
+          "required": false,
+          "description": "Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster."
+        }
+      },
+      "params": {
+        "routing": {
+          "type": "list",
+          "description": "A comma-separated list of specific routing values"
+        },
+        "preference": {
+          "type": "string",
+          "description": "Specify the node or shard the operation should be performed on (default: random)"
+        },
+        "ignore_unavailable": {
+          "type": "boolean",
+          "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
+        },
+        "allow_no_indices": {
+          "type": "boolean",
+          "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
+        },
+        "expand_wildcards": {
+          "type": "enum",
+          "options": ["open", "closed"],
+          "default": "open",
+          "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both."
+        },
+        "percolate_index": {
+          "type": "string",
+          "description": "The index to count percolate the document into. Defaults to index."
+        },
+        "percolate_type": {
+          "type": "string",
+          "description": "The type to count percolate document into. Defaults to type."
+        },
+        "version": {
+          "type": "number",
+          "description": "Explicit version number for concurrency control"
+        },
+        "version_type": {
+          "type": "enum",
+          "options": ["internal", "external"],
+          "description": "Specific version type"
+        }
+      }
+    },
+    "body": {
+      "description": "The count percolator request definition using the percolate DSL",
+      "required": false
+    }
+  }
+}

+ 40 - 0
rest-api-spec/api/mpercolate.json

@@ -0,0 +1,40 @@
+{
+  "mpercolate": {
+    "documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html",
+    "methods": ["GET", "POST"],
+    "url": {
+      "path": "/_mpercolate",
+      "paths": ["/_mpercolate", "/{index}/_mpercolate", "/{index}/{type}/_mpercolate"],
+      "parts": {
+        "index": {
+          "type": "string",
+          "description": "The index of the document being count percolated to use as default"
+        },
+        "type": {
+          "type" : "string",
+          "description" : "The type of the document being percolated to use as default."
+        }
+      },
+      "params": {
+        "ignore_unavailable": {
+          "type": "boolean",
+          "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
+        },
+        "allow_no_indices": {
+          "type": "boolean",
+          "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
+        },
+        "expand_wildcards": {
+          "type": "enum",
+          "options": ["open", "closed"],
+          "default": "open",
+          "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both."
+        }
+      }
+    },
+    "body": {
+      "description": "The percolate request definitions (header & body pair), separated by newlines",
+      "required": true
+    }
+  }
+}

+ 47 - 7
rest-api-spec/api/percolate.json

@@ -4,29 +4,69 @@
     "methods": ["GET", "POST"],
     "url": {
       "path": "/{index}/{type}/_percolate",
-      "paths": ["/{index}/{type}/_percolate"],
+      "paths": ["/{index}/{type}/_percolate", "/{index}/{type}/{id}/_percolate"],
       "parts": {
         "index": {
           "type" : "string",
           "required" : true,
-          "description" : "The name of the index with a registered percolator query"
+          "description" : "The index of the document being percolated."
         },
         "type": {
           "type" : "string",
           "required" : true,
-          "description" : "The document type"
+          "description" : "The type of the document being percolated."
+        },
+        "id": {
+          "type" : "string",
+          "required" : false,
+          "description" : "Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster."
         }
       },
       "params": {
-        "prefer_local": {
+        "routing": {
+          "type" : "list",
+          "description" : "A comma-separated list of specific routing values"
+        },
+        "preference": {
+          "type" : "string",
+          "description" : "Specify the node or shard the operation should be performed on (default: random)"
+        },
+        "ignore_unavailable": {
+          "type" : "boolean",
+          "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)"
+        },
+        "allow_no_indices": {
           "type" : "boolean",
-          "description" : "With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)"
+          "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
+        },
+        "expand_wildcards": {
+          "type" : "enum",
+          "options" : ["open","closed"],
+          "default" : "open",
+          "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both."
+        },
+        "percolate_index": {
+          "type" : "string",
+          "description" : "The index to percolate the document into. Defaults to index."
+        },
+        "percolate_type": {
+          "type" : "string",
+          "description" : "The type to percolate document into. Defaults to type."
+        },
+        "version" : {
+          "type" : "number",
+          "description" : "Explicit version number for concurrency control"
+        },
+        "version_type": {
+          "type" : "enum",
+          "options" : ["internal","external"],
+          "description" : "Specific version type"
         }
       }
     },
     "body": {
-      "description" : "The document (`doc`) to percolate against registered queries; optionally also a `query` to limit the percolation to specific registered queries",
-      "required" : true
+      "description" : "The percolator request definition using the percolate DSL",
+      "required" : false
     }
   }
 }