Commit graph

548 commits

Author SHA1 Message Date
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
Mayya Sharipova
3260fd1fc8
Distance measures for dense and sparse vectors (#37947)
* Distance measures for dense and sparse vectors

Introduce painless functions of
cosineSimilarity and dotProduct distance
measures for dense and sparse vector fields.

```js
{
  "query": {
    "script_score": {
      "query": {
        "match_all": {}
      },
      "script": {
        "source": "cosineSimilarity(params.queryVector, doc['my_dense_vector'].value)",
        "params": {
          "queryVector": [4, 3.4, -1.2]
        }
      }
    }
  }
}
```

```js
{
  "query": {
    "script_score": {
      "query": {
        "match_all": {}
      },
      "script": {
        "source": "cosineSimilaritySparse(params.queryVector, doc['my_sparse_vector'].value)",
        "params": {
          "queryVector": {"2": -0.5, "10" : 111.3, "50": -13.0, "113": 14.8, "4545": -156.0}
        }
      }
    }
  }
}
```

Closes #31615
2019-02-20 07:01:17 -05:00
Alan Woodward
8c2c1cbd96
Add overlapping, before, after filters to intervals query (#38999)
Lucene recently added `overlapping`, `before` and `after` filters to the intervals package. This
commit exposes them in elasticsearch.
2019-02-18 14:44:07 +00:00
Alexander Reelsen
5f7168ea74
Remove joda time mentions in documentation (#38720)
This is the forward port of #38720 (not containing the 7.0 migration docs)
2019-02-14 10:18:48 +01:00
Mayya Sharipova
479c0c78b7
Add fuzziness example (#37194) (#38648)
The example in the Fuzziness section was actually relevant to the section above it, so I moved it there. I replaced it with an example of how to use the `fuzziness` parameter
2019-02-08 15:41:00 -05:00
Jim Ferenczi
787acb14b9
Track total hits up to 10,000 by default (#37466)
This commit changes the default for the `track_total_hits` option of the search request
to `10,000`. This means that by default search requests will accurately track the total hit count
up to `10,000` documents, requests that match more than this value will set the `"total.relation"`
to `"gte"` (e.g. greater than or equals) and the `"total.value"` to `10,000` in the search response.
Scroll queries are not impacted, they will continue to count the total hits accurately.
The default is set back to `true` (accurate hit count) if `rest_total_hits_as_int` is set in the search request.
I choose `10,000` as the default because that's also the number we use to limit pagination. This means that users will be able to know how far they can jump (up to 10,000) even if the total number of hits is not accurate.

Closes #33028
2019-01-25 13:45:39 +01:00
Mayya Sharipova
a30ce6a00a
Rename feature, feature_vector and feature_query (#37794)
Ranaming as follows:
feature -> rank_feature
feature_vector -> rank_features
feature query -> rank_feature query

Ranaming is done to distinguish from other vector types.

Closes #36723
2019-01-24 19:18:48 -05:00
Mayya Sharipova
fdb66039d4
Change rational to saturation in script_score (#37766)
This change of the function name is necessary for conformity
with feature queries.

Closes #37714
2019-01-23 14:28:20 -05:00
Mayya Sharipova
942fc13af5
Use plain text instead of latexmath
As latexmath is not rendered, using plain text instead

Closes #37718
2019-01-22 16:49:03 -05:00
Christoph Büscher
34f2d2ec91
Remove remaining occurances of "include_type_name=true" in docs (#37646) 2019-01-22 15:13:52 +01:00
Christoph Büscher
25aac4f77f
Remove include_type_name in asciidoc where possible (#37568)
The "include_type_name" parameter was temporarily introduced in #37285 to facilitate
moving the default parameter setting to "false" in many places in the documentation
code snippets. Most of the places can simply be reverted without causing errors.
In this change I looked for asciidoc files that contained the
"include_type_name=true" addition when creating new indices but didn't look
likey they made use of the "_doc" type for mappings. This is mostly the case
e.g. in the analysis docs where index creating often only contains settings. I
manually corrected the use of types in some places where the docs still used an
explicit type name and not the dummy "_doc" type.
2019-01-18 09:34:11 +01:00
Julie Tibshirani
36a3b84fc9
Update the default for include_type_name to false. (#37285)
* Default include_type_name to false for get and put mappings.

* Default include_type_name to false for get field mappings.

* Add a constant for the default include_type_name value.

* Default include_type_name to false for get and put index templates.

* Default include_type_name to false for create index.

* Update create index calls in REST documentation to use include_type_name=true.

* Some minor clean-ups around the get index API.

* In REST tests, use include_type_name=true by default for index creation.

* Make sure to use 'expression == false'.

* Clarify the different IndexTemplateMetaData toXContent methods.

* Fix FullClusterRestartIT#testSnapshotRestore.

* Fix the ml_anomalies_default_mappings test.

* Fix GetFieldMappingsResponseTests and GetIndexTemplateResponseTests.

We make sure to specify include_type_name=true during xContent parsing,
so we continue to test the legacy typed responses. XContent generation
for the typeless responses is currently only covered by REST tests,
but we will be adding unit test coverage for these as we implement
each typeless API in the Java HLRC.

This commit also refactors GetMappingsResponse to follow the same appraoch
as the other mappings-related responses, where we read include_type_name
out of the xContent params, instead of creating a second toXContent method.
This gives better consistency in the response parsing code.

* Fix more REST tests.

* Improve some wording in the create index documentation.

* Add a note about types removal in the create index docs.

* Fix SmokeTestMonitoringWithSecurityIT#testHTTPExporterWithSSL.

* Make sure to mention include_type_name in the REST docs for affected APIs.

* Make sure to use 'expression == false' in FullClusterRestartIT.

* Mention include_type_name in the REST templates docs.
2019-01-14 13:08:01 -08:00