Commit Graph

659 Commits

Author SHA1 Message Date
Mayya Sharipova 620996287a
Remove docs related to index time boosting (#51704)
As there is no really index time boosting,
as boost is only applied during query time,
this removes mentions of index time boosting.
2020-01-31 09:01:52 -05:00
Russ Cam ff22445364 [Docs] Including leading slash in range query doc example URLs (#51277) 2020-01-22 09:38:52 +01:00
Tal Levy 6c86606d2a
Adds support for geo-bounds filtering in geogrid aggregations (#50002)
It is fairly common to filter the geo point candidates in
geohash_grid and geotile_grid aggregations according to some
viewable bounding box. This change introduces the option of
specifying this filter directly in the tiling aggregation.

This is even more relevant to `geo_shape` where the bounds will restrict
the shape to be within the bounds

this optional `bounds` parameter is parsed in an equivalent fashion to 
the bounds specified in the geo_bounding_box query.
2020-01-14 08:29:10 -08:00
James Rodewig 979bfa6691
[DOCS] Fix time_zone example in range query docs (#50830)
One of the example snippets in the range query docs was missing a
required 'T' in the `date` format. This adds the required 'T'.
2020-01-10 07:23:25 -06:00
James Rodewig e090b9bcad
[DOCS] Fuzzy wildcard not supported in `query_string` (#50466)
The `query_string` does not support mixing wildcards with fuzziness.
This adds a related warning to the `query_string` docs.
2020-01-07 12:53:47 -06:00
Orhan Toy 0db416921c [DOCS] Fix missing quote in script-score-query.asciidoc (#50590) 2020-01-03 16:15:18 +01:00
Alan Woodward 32730cfdc5
Add fuzzy intervals source (#49762)
This intervals source will return terms that are similar to an input term, up to
an edit distance defined by fuzziness, similar to FuzzyQuery.

Closes #49595
2020-01-03 09:55:53 +00:00
James Rodewig cfddddda0b
[DOCS] Fix search request body links (#50500)
PR #44238 changed several links related to the Elasticsearch search request body API. This updates several places still using outdated links or anchors.

This will ultimately let us remove some redirects related to those link changes.
2019-12-26 14:20:51 -05:00
Xiang Dai 432bd0e92c Fix docs typos (#50365)
Fixes a few typos in the docs.

Signed-off-by: Xiang Dai 764524258@qq.com
2019-12-23 10:35:14 -05:00
Christoph Büscher 7f90ff64a3
[Docs] Remove `intervals` filter rule from allowed top-level rules (#50320)
The `filter` rule is not allowed on the top-level of the query, so removing it
from the list of allowed rules. Where it can be nested inside other rules, those
rules already mention it.
2019-12-18 17:35:35 +01:00
Ignacio Vera 7c559be31c
"CONTAINS" support for BKD-backed geo_shape and shape fields (#50141)
Lucene 8.4 added support for "CONTAINS", therefore in this commit those
changes are integrated in Elasticsearch. This commit contains as well a
bug fix when querying with a geometry collection with "DISJOINT" relation.
2019-12-16 07:43:42 +01:00
Peter Johnson 263f5bd6b6 [Docs] Fix typo in function-score-query.asciidoc (#50030) 2019-12-10 17:33:36 +01:00
James Rodewig 4415f1a536
[DOCS] Correct inline shape snippets in shape query docs (#49921)
In the shape query docs, the index mapping snippet uses the "geometry"
shape field mapping. However, the doc index snippet uses the "location"
property.

This changes the "location" property to "geometry". It also adds a
comment containing the search result snippet. This should prevent
similar issues in the future.
2019-12-09 08:39:17 -05:00
James Rodewig 72dd49ddcc
[DOCS] Document `minimum_should_match` defaults for `bool` query (#48865)
Adds documentation for the `minimum_should_match` parameter to the `bool` query docs. Includes docs for the default values:

- `1` if the `bool` query includes at least one `should` clause and no `must` or `filter` clauses
- `0` otherwise
2019-12-04 12:44:13 -05:00
Christoph Büscher 0162662eb8
[Docs] Correct `max_doc_freq` default value (#49536)
The default is set to Integer.MAX_VALUE but is reported to be `0` in the docs.
With the current implementation a value of 0 would mean all terms are filtered
out, which is the opposite of "unbounded".

Closes #49520
2019-11-26 10:46:44 +01:00
James Rodewig 1e45db49ec
[DOCS] Document `script_score` float precision limit (#49402)
All document scores are positive 32-bit floating point numbers. However, this
wasn't previously documented.

This can result in surprising behavior, such as precision loss, for users when
customizing scores using the function score query.

This commit updates an existing admonition in the function score query docs to
document the 32-bits precision limit. It also updates the search API reference
docs to note that `_score` is a 32-bit float.
2019-11-21 08:53:56 -05:00
markharwood 29a13007e4 [DOCS] Add TermVectors API reference to MLT query docs (#37228)
Adds a reference the use of the TermVectors API following an issue raised about lack of flexibility in the MLT query: https://github.com/elastic/elasticsearch/issues/35509
2019-10-18 10:02:19 -04:00
Anton 88346ff8a5 [DOCS] Fix typo in intervals query docs (#48180) 2019-10-17 09:15:21 -04:00
David Woods 8142ac4d5e Add a note to query_string docs around spaces in field names. (#47326) 2019-10-16 13:25:48 -07:00
Alan Woodward 566e1b7d33
Remove type field from DocWriteRequest and associated Response objects (#47671)
This commit removes the type field from index, update and delete requests, and their
associated responses.

Relates to #41059
2019-10-11 10:23:55 +01:00
Ryan Ernst d8b4556e2d
Add explanations to script score queries (#46693)
While function scores using scripts do allow explanations, they are only
creatable with an expert plugin. This commit improves the situation for
the newer script score query by adding the ability to set the
explanation from the script itself.

To set the explanation, a user would check for `explanation != null` to
indicate an explanation is needed, and then call
`explanation.set("some description")`.
2019-10-03 19:35:59 -07:00
James Rodewig eb454558fb [DOCS] Correct snippet in query string syntax 2019-09-30 11:25:13 -04:00
Andrew Naguib b4506019d5 [DOCS] Note double backslashes (`\\`) are required to escape JSON chars (#46863) 2019-09-30 11:19:50 -04:00
James Rodewig 07761530c1
[DOCS] Add multi-level nested query example to nested query docs (#46986) 2019-09-25 00:56:15 -04:00
Alan Woodward c1f99e2d75
Remove `_type` from SearchHit (#46942)
This commit removes the `_type` field from all search hit responses.

Relates to #41059
2019-09-23 19:14:54 +01:00
rikardbakkehaug 212e3e4075 [DOCS] Correct date math ex for `gt` and `gte` parms in `range` query docs (#46873) 2019-09-19 16:38:42 -04:00
James Rodewig 5c78f606c2
[DOCS] Change // CONSOLE comments to [source,console] (#46440) 2019-09-09 10:45:37 -04:00
Suhel Khan 47478921ac [Docs] Fix typo in minimum-should-match.asciidoc (#46472) 2019-09-09 14:17:49 +02:00
James Rodewig e43be90e6c
[DOCS] [5 of 5] Change // TESTRESPONSE comments to [source,console-results] (#46449) 2019-09-06 14:05:36 -04:00
James Rodewig 466c59a4a7
[DOCS] Replace "// TESTRESPONSE" magic comments with "[source,console-result] (#46295) 2019-09-05 16:47:18 -04:00
James Rodewig 95655162f3
[DOCS] Reformat match query (#45152) 2019-08-22 15:29:14 -04:00
markharwood f0dbc68187
Search enhancement: pinned queries (#44345)
Search enhancement: - new query type allows selected documents to be promoted above any "organic” search results.
This is the first feature in a new module `search-business-rules` which will house licensed (non OSS) logic for rewriting queries according to business rules.
The PinnedQueryBuilder class offers a new `pinned` query in the DSL that takes an array of promoted IDs and an “organic” query and ensures the documents with the promoted IDs rank higher than the organic matches.

Closes #44074
2019-08-16 14:46:06 +01:00
James Rodewig 9c488f3ea1
[DOCS] Rewrite `fuzzy` query docs (#42078) 2019-08-14 13:06:23 -04:00
James Rodewig c4bc45fca3
[DOCS] Reformat query string query (#45296) 2019-08-12 11:17:19 -04:00
James Rodewig af70fb9288
[DOCS] Reformats interval query (#45350) 2019-08-09 08:53:25 -04:00
James Rodewig bf0ac30b79
[DOCS] Reformats simple query string query (#45343) 2019-08-09 08:32:46 -04:00
Nick Knize c89b66afcb
[SPATIAL] New ShapeQueryBuilder for querying indexed cartesian geometry (#45108)
This commit adds a new ShapeQueryBuilder to the xpack spatial module for
querying arbitrary Cartesian geometries indexed using the new shape field
type.

The query builder extends AbstractGeometryQueryBuilder and leverages the
ShapeQueryProcessor added in the previous field mapper commit.

Tests are provided in ShapeQueryTests in the same manner as
GeoShapeQueryTests and docs are updated to explain how the query works.
2019-08-08 15:28:35 -05:00
James Rodewig 1cc4aa176f
[DOCS] Reformat match phrase prefix query (#45209) 2019-08-06 14:01:49 -04:00
James Rodewig 08ea6a79fb
[DOCS] Update relevance score cross-references (#45092) 2019-08-02 14:15:12 -04:00
James Rodewig e1fe213d8f
[DOCS] Reformat script score query (#45087) 2019-08-01 12:06:34 -04:00
James Rodewig d9b2d8d9cf
[DOCS] Reformat rank feature query. Add relevance score section. (#44975) 2019-07-31 14:31:28 -04:00
James Rodewig f167b2f909
[DOCS] Update parameter format (#44703) 2019-07-31 14:18:22 -04:00
James Rodewig 3be9a3bd2c
[DOCS] Reformat script query (#44882) 2019-07-29 09:59:09 -04:00
James Rodewig a5df840c24
[DOCS] Rewrite `prefix` query docs (#41955) 2019-07-29 08:37:01 -04:00
James Rodewig 45be90954e
[DOCS] Reformat distance feature query (#44916) 2019-07-29 08:34:50 -04:00
James Rodewig 8b2493ca9f
[DOCS] Rewrite `regexp` query (#42711) 2019-07-24 08:37:37 -04:00
James Rodewig 3c92e8eb1a
[DOCS] Reformat `parent_id` query docs (#44449) 2019-07-19 11:03:06 -04:00
James Rodewig f3ddd36d05
[DOCS] Reformat `has_parent` query docs (#44443) 2019-07-19 10:50:36 -04:00
James Rodewig ea1adb61c2
[DOCS] Update anchors and links for Elasticsearch API relocation (#44500) 2019-07-19 09:16:35 -04:00
James Rodewig ec37a9cea0
[DOCS] Make Query DSL titles consistent (#43935) 2019-07-18 10:18:11 -04:00
Mayya Sharipova 16747f811f
Add l1norm and l2norm distances for vectors (#44116)
* Add l1norm and l2norm distances for vectors

Add L1norm - Manhattan distance
Add L2norm - Euclidean distance
relates to #37947

* Address Christoph's feedback

- organize vector functions as a separate doc
- increase precision in tests calculations
- add a separate test when sparse doc dims
are bigger and less than query vector dims

* Made examples more realistic
2019-07-11 14:14:23 -04:00
James Rodewig e04c8464c7
[DOCS] Rewrite `has_child` query to use new format (#44190) 2019-07-11 09:10:39 -04:00
James Rodewig 4ad081b1e7 [DOCS] Correct `ignore_unmapped` parm typo for nested query 2019-07-10 10:08:36 -04:00
James Rodewig 593e1636ab
[DOCS] Rewrite nested query to use new format (#44130) 2019-07-10 08:50:54 -04:00
Mayya Sharipova 5255eb3c77
Forbid empty doc values on vector functions (#43944)
Currently when a document misses a vector value, vector function
returns 0 as a score for this document. We think this is incorrect
behaviour.
With this change, an error will be thrown if vector functions are
used with docs that are missing vector doc values.
Also VectorScriptDocValues is modified to allow size() function,
which can be used to check if a document has a value for the
vector field.
2019-07-05 17:59:13 -04:00
James Rodewig 0753b412cc
[DOCS] Rewrite dis max query (#43586) 2019-07-03 08:55:50 -04:00
Mayya Sharipova 66e1e5643f
Add dims parameter to dense_vector mapping (#43444)
Typically, dense vectors of both documents and queries must have the same
number of dimensions. Different number of dimensions among documents
or query vector indicate an error. This PR enforces that all vectors
for the same field have the same number of dimensions. It also enforces
that query vectors have the same number of dimensions.
2019-07-02 16:21:10 -04:00
James Rodewig b490eab3a5
[DOCS] Rewrite `terms_set` query (#43060) 2019-06-28 12:56:22 -04:00
Alan Woodward 89a3eb3c6f
Wildcard intervals (#43691)
This commit adds a wildcard intervals source, similar to the prefix. It
also changes the term parameter in prefix to read prefix, to bring it
in to line with the pattern parameter in wildcard.

Closes #43198
2019-06-28 13:58:06 +01:00
James Rodewig 623a5ddac0
[DOCS] Rewrite boosting query (#43647) 2019-06-28 08:35:20 -04:00
Alan Woodward a520a5d761
Add prefix intervals source (#43635)
This commit adds a prefix intervals source, allowing you to search
for intervals that contain terms starting with a given prefix. The source
can make use of the index_prefixes mapping option.

Relates to #43198
2019-06-26 15:36:47 +01:00
James Rodewig 5f6321aacb
[DOCS] Rewrite `range` query (#43282) 2019-06-25 15:24:44 -04:00
rbayet 05689de55f
Fixing backquote in fail_on_unsupported_field (#43572) 2019-06-25 16:35:13 +02:00
James Rodewig 086c330923
[DOCS] Rewrite `constant_score` query (#43374) 2019-06-21 12:03:19 -04:00
James Rodewig 97f70c5e27
[DOCS] Rewrite term-level queries overview (#43337) 2019-06-21 11:53:01 -04:00
Christoph Büscher b08ba28c9b
[Docs] Remove boost parameter from intervals-query example (#43331)
The boost factor doesn't seem to be needed and can be removed.
2019-06-20 10:33:48 +02:00
Tal Levy 13dde65e75
specifies which index to search in docs for various queries (#43307)
the geo-bounding-box and phrase-suggest docs were susceptible to
failing due to other indices in the cluster. This change restricts
the queries to the index that is set up for the test.

relates to #43271.
2019-06-18 08:18:50 -07:00
Mayya Sharipova 952ddf247a
Move dense_vector and sparse_vector to module (#43280) 2019-06-18 08:15:46 -04:00
markharwood 58da54e2d0
Docs change for exists query. (#43092)
Now emphasises the test is for indexed values.
Previous documentation only mentioned the state of the input JSON doc (null values) but this is only one of several reasons why an indexed value may not exist.

Closes #24256
2019-06-12 09:26:26 +01:00
Shubham Vipul Majmudar 1fa67ce85f Update regexp-syntax.asciidoc (#43021)
Corrects a typo.
2019-06-10 10:14:18 +01:00
James Rodewig cb527c2ece
[DOCS] Rewrite terms query (#42889) 2019-06-06 08:32:42 -04:00
Christoph Büscher ffc5534584
[Docs] Clarify caveats for phonetic filters replace option (#42807)
The `replace` option in the phonetic token filter can have suprising side
effects, e.g. such as described in #26921. This PR adds a note to be mindful
about such scenarios and offers alternatives to using the `replace` option.

Closes #26921
2019-06-05 22:02:17 +02:00
Marios Trivyzas 69993049a8
[Docs] Fix reference to `boost` and `slop` params (#42803)
For `multi_match` query: link `boost` param to the generic reference
for query usage and `slop` to the `match_phrase` query where its usage
is documented.

Fixes: #40091
2019-06-03 22:56:39 +02:00
Marios Trivyzas 6dd4d2b7a6
Remove CommonTermsQuery and cutoff_frequency param (#42654)
Remove `common` query and `cutoff_frequency` parameter of
`match` and `multi_match` queries. Both have already been
deprecated for the next 7.x version.

Closes: #37096
2019-05-31 17:06:06 +02:00
James Rodewig 7f3e0806dc
[DOCS] Rewrite 'wildcard' query (#42670) 2019-05-30 08:30:30 -04:00
Marios Trivyzas 04b7449731
Deprecate CommonTermsQuery and cutoff_frequency (#42619)
* Deprecate CommonTermsQuery and cutoff_frequency

Since the max_score optimization landed in Elasticsearch 7,
the CommonTermsQuery is redundant and slower. Moreover the
cutoff_frequency parameter for MatchQuery and MultiMatchQuery
is redundant.

Relates to #27096
2019-05-30 09:31:11 +02:00
Mayya Sharipova e0041930a1
Add warning scores are floats (#42667) 2019-05-29 16:09:36 -04:00
Christoph Büscher 5fb55f62be
Remove type-related methods from QueryBuilders (#42284)
Removes all deprecated type-related methods from the QueryBuilders helper class
and from tests using them. Also removing related docs tests and doc pages
refering to the `type` query. All removed methods have been deprecated since
version 7.0.
2019-05-22 05:15:54 -04:00
Mayya Sharipova 6f8dfeb6b5
Add experimental and warnings to vector functions (#42205) 2019-05-21 06:36:38 -04:00
James Rodewig 45e1e59371
[DOCS] Rewrite 'rewrite' parameter docs (#42018) 2019-05-13 08:42:26 -04:00
James Rodewig 731dac765e
[DOCS] Replace table with def list for ids query (#41865) 2019-05-09 09:51:12 -04:00
James Rodewig 49c9daa268
[DOCS] Rewrite `exists` query docs (#41868) 2019-05-07 09:22:59 -04:00
James Rodewig 8541dd8031
[DOCS] Rewrite `term` query docs for new format (#41498)
* [DOCS] Restructure `term` query docs.
2019-05-06 10:36:07 -04:00
Gordon Brown cd3a3f44d2
Recommend use of ln1p/log1p to avoid negative scores (#41610)
As negative scores will now cause an error, and it is easy to
accidentally produce negative scores with some of the built-in modifiers
(especially `ln` and `log`), this adjusts the documentation to more
strongly recommend the use of `ln1p` and `log1p` instead.

Also corrects some awkward formatting on the note sections following the
table.
2019-05-02 16:22:03 -06:00
James Rodewig 7639e6a398
[DOCS] Reword `type` query deprecation note for Asciidoctor migration (#41595) 2019-05-01 09:28:12 -04:00
James Rodewig adf67053f4
[DOCS] Add anchors for Asciidoctor migration (#41648) 2019-04-30 10:19:09 -04:00
Mayya Sharipova 29701b0229
Remove experimental label froms script_score query (#41572) 2019-04-26 08:50:27 -04:00
James Rodewig 391ac5a709
[DOCS] Fix callout for Asciidoctor migration (#41129) 2019-04-11 15:46:13 -04:00
James Rodewig 1f27833614
[DOCS] Restructure `ids` to new query docs format (#41077) 2019-04-10 14:35:24 -04:00
Alan Woodward 8d5b75ebdd
Document restrictions on fuzzy matching when using synonyms (#40783)
Relates to #25518
2019-04-04 09:07:42 +01:00
Andy Bristol d51cbc664e
fix summary of phrase_prefix scoring (#40567)
The language here implies that phrase_prefix scoring works like
most_fields, but it actually works like best_fields
2019-04-01 12:03:25 -07:00
Christoph Büscher c9d05adedd
Clarify using time_zone and date math in range query (#40655)
Currently, the docs correctly state that using `now` in range queries will not
be affected by the `time_zone` parameter. However, using date math roundings
like e.g. `now\d` will be affected by the `time_zone`. Adding this example
because it seems to be a frequently asked question and source of confusion.

Relates to #40581
2019-03-29 23:38:37 +01:00
Julie Tibshirani 5901b4286e
Update vector similarity examples to avoid negative scores. (#40493)
Negative scores are no longer allowed, but the cosine similarity between two
vectors lies in the range [-1, 1], and dot products can also be negative. This commit
updates the documentation with an example of how to avoid negative scores.
2019-03-29 11:29:54 -07:00
Mayya Sharipova 459715dba7
Add randomScore function in script_score query (#40186)
To make script_score query to have the same features
as function_score query, we need to add randomScore
function.

This function produces different
random scores on different index shards.
It is also able to produce random scores
based on the internal Lucene Document Ids.
2019-03-28 11:29:29 -04:00
Andy Bristol 6bba9fc83b
search as you type fieldmapper (#35600)
Adds the search_as_you_type field type that acts like a text field optimized
for as-you-type search completion. It creates a couple subfields that analyze
the indexed terms as shingles, against which full terms are queried, and a
prefix subfield that analyze terms as the largest shingle size used and
edge-ngrams, against which partial terms are queried

Adds a match_bool_prefix query type that creates a boolean clause of a term
query for each term except the last, for which a boolean clause with a prefix
query is created.

The match_bool_prefix query is the recommended way of querying a search as you
type field, which will boil down to term queries for each shingle of the input
text on the appropriate shingle field, and the final (possibly partial) term
as a term query on the prefix field. This field type also supports phrase and
phrase prefix queries however
2019-03-27 10:03:30 -07:00
Alan Woodward 64a53e42cd
Add `use_field` option to intervals query (#40157)
This is the equivalent of the `field_masking_span` query, allowing users to
merge intervals from multiple fields - for example, to search for stemmed tokens
near unstemmed tokens.
2019-03-20 16:25:15 +00:00
avshiav 955ccf2583 [DOCS] Fixed missing space (#38305) 2019-03-20 16:18:01 +01:00
Mayya Sharipova a87b1391d6
Expose proximity boosting (#39385)
Expose DistanceFeatureQuery for geo, date and date_nanos types

Closes #33382
2019-03-19 07:04:35 -04:00
Adrien Grand 62f0895424
Make the `type` parameter optional when percolating existing documents. (#39987)
`document_type` is the type to use for parsing the document to percolate, which
is already optional and deprecated. However `percotale` queries also have the
ability to percolate existing documents, identified by an index, an id and a
type. This change makes the latter optional and deprecated.

Closes #39963
2019-03-13 11:33:24 +01:00
MK Swanson 347e8cf69b
[DOCS] Edited intro sentence for clarity. Closes #39865 (#39866) 2019-03-08 17:29:37 -05:00