parent
5fbc86e2aa
commit
e429d66956
|
@ -80,13 +80,6 @@ buildRestTests.expectedUnconvertedCandidates = [
|
|||
'reference/indices/shard-stores.asciidoc',
|
||||
'reference/ingest/ingest-node.asciidoc',
|
||||
'reference/mapping/dynamic/templates.asciidoc',
|
||||
'reference/mapping/fields/all-field.asciidoc',
|
||||
'reference/mapping/params/analyzer.asciidoc',
|
||||
'reference/mapping/types/binary.asciidoc',
|
||||
'reference/mapping/types/ip.asciidoc',
|
||||
'reference/mapping/types/nested.asciidoc',
|
||||
'reference/mapping/types/object.asciidoc',
|
||||
'reference/mapping/types/percolator.asciidoc',
|
||||
'reference/modules/cross-cluster-search.asciidoc', // this is hard to test since we need 2 clusters -- maybe we can trick it into referencing itself...
|
||||
'reference/search/field-stats.asciidoc',
|
||||
'reference/search/profile.asciidoc',
|
||||
|
|
|
@ -101,6 +101,8 @@ requests>> (which is rewritten to a `query_string` query internally):
|
|||
--------------------------------
|
||||
GET _search?q=john+smith+new+york
|
||||
--------------------------------
|
||||
// TEST[skip:_all is no longer allowed]
|
||||
// CONSOLE
|
||||
|
||||
Other queries, such as the <<query-dsl-match-query,`match`>> and
|
||||
<<query-dsl-term-query,`term`>> queries require you to specify the `_all` field
|
||||
|
|
|
@ -135,11 +135,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT my_index/my_type/1
|
||||
{
|
||||
"title":"The Quick Brown Fox"
|
||||
|
@ -159,6 +155,7 @@ GET my_index/my_type/_search
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
<1> `my_analyzer` analyzer which tokens all terms including stop words
|
||||
<2> `my_stop_analyzer` analyzer which removes stop words
|
||||
<3> `analyzer` setting that points to the `my_analyzer` analyzer which will be used at index time
|
||||
|
|
|
@ -29,6 +29,7 @@ PUT my_index/my_type/1
|
|||
"blob": "U29tZSBiaW5hcnkgYmxvYg==" <1>
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
<1> The Base64 encoded binary value must not have embedded newlines `\n`.
|
||||
|
||||
[[binary-params]]
|
||||
|
@ -49,5 +50,3 @@ The following parameters are accepted by `binary` fields:
|
|||
Whether the field value should be stored and retrievable separately from
|
||||
the <<mapping-source-field,`_source`>> field. Accepts `true` or `false`
|
||||
(default).
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ GET my_index/_search
|
|||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
// TESTSETUP
|
||||
|
||||
[[ip-params]]
|
||||
==== Parameters for `ip` fields
|
||||
|
@ -86,6 +86,7 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
or
|
||||
|
||||
|
@ -100,6 +101,7 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Also beware that colons are special characters to the
|
||||
<<query-dsl-query-string-query,`query_string`>> query, so ipv6 addresses will
|
||||
|
@ -108,7 +110,7 @@ searched value:
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
GET t/_search
|
||||
GET my_index/_search
|
||||
{
|
||||
"query": {
|
||||
"query_string" : {
|
||||
|
@ -117,3 +119,4 @@ GET t/_search
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
|
|
@ -42,6 +42,7 @@ would be transformed internally into a document that looks more like this:
|
|||
"user.last" : [ "smith", "white" ]
|
||||
}
|
||||
--------------------------------------------------
|
||||
// NOTCONSOLE
|
||||
|
||||
The `user.first` and `user.last` fields are flattened into multi-value fields,
|
||||
and the association between `alice` and `white` is lost. This document would
|
||||
|
|
|
@ -35,6 +35,7 @@ pairs, something like this:
|
|||
"manager.name.last": "Smith"
|
||||
}
|
||||
--------------------------------------------------
|
||||
// NOTCONSOLE
|
||||
|
||||
An explicit mapping for the above document could look like this:
|
||||
|
||||
|
@ -96,4 +97,3 @@ The following parameters are accepted by `object` fields:
|
|||
|
||||
IMPORTANT: If you need to index arrays of objects instead of single objects,
|
||||
read <<nested>> first.
|
||||
|
||||
|
|
|
@ -15,27 +15,39 @@ If the following mapping configures the `percolator` field type for the
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
{
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "percolator"
|
||||
"mappings": {
|
||||
"doc": {
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "percolator"
|
||||
},
|
||||
"field": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TESTSETUP
|
||||
|
||||
Then the following json snippet can be indexed as a native query:
|
||||
Then you can index a query:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT my_index/doc/match_value
|
||||
{
|
||||
"query" : {
|
||||
"match" : {
|
||||
"field" : "value"
|
||||
}
|
||||
}
|
||||
"match" : {
|
||||
"field" : "value"
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
[IMPORTANT]
|
||||
=====================================
|
||||
|
@ -82,4 +94,4 @@ queries are indexed by the `percolator` field type then the get call is executed
|
|||
query evaluates these queries, the fetches terms, shapes etc. as the were upon index time will be used. Important to note
|
||||
is that fetching of terms that these queries do, happens both each time the percolator query gets indexed on both primary
|
||||
and replica shards, so the terms that are actually indexed can be different between shard copies, if the source index
|
||||
changed while indexing.
|
||||
changed while indexing.
|
||||
|
|
Loading…
Reference in New Issue