Skip to content

Commit c1f97f4

Browse files
carlosdelestalbertzaharovits
authored andcommitted
Group vector queries into new section (#110722)
1 parent a9d469d commit c1f97f4

File tree

5 files changed

+51
-29
lines changed

5 files changed

+51
-29
lines changed

docs/reference/query-dsl.asciidoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,12 @@ include::query-dsl/match-all-query.asciidoc[]
7272

7373
include::query-dsl/span-queries.asciidoc[]
7474

75+
include::query-dsl/vector-queries.asciidoc[]
76+
7577
include::query-dsl/special-queries.asciidoc[]
7678

7779
include::query-dsl/term-level-queries.asciidoc[]
7880

79-
include::query-dsl/text-expansion-query.asciidoc[]
80-
81-
include::query-dsl/sparse-vector-query.asciidoc[]
82-
8381
include::query-dsl/minimum-should-match.asciidoc[]
8482

8583
include::query-dsl/multi-term-rewrite.asciidoc[]

docs/reference/query-dsl/sparse-vector-query.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[query-dsl-sparse-vector-query]]
2-
== Sparse vector query
2+
=== Sparse vector query
33

44
++++
55
<titleabbrev>Sparse vector</titleabbrev>
@@ -19,7 +19,7 @@ For example, a stored vector `{"feature_0": 0.12, "feature_1": 1.2, "feature_2":
1919

2020
[discrete]
2121
[[sparse-vector-query-ex-request]]
22-
=== Example request using an {nlp} model
22+
==== Example request using an {nlp} model
2323

2424
[source,console]
2525
----
@@ -37,7 +37,7 @@ GET _search
3737
// TEST[skip: Requires inference]
3838

3939
[discrete]
40-
=== Example request using precomputed vectors
40+
==== Example request using precomputed vectors
4141

4242
[source,console]
4343
----
@@ -55,7 +55,7 @@ GET _search
5555

5656
[discrete]
5757
[[sparse-vector-field-params]]
58-
=== Top level parameters for `sparse_vector`
58+
==== Top level parameters for `sparse_vector`
5959

6060
`field`::
6161
(Required, string) The name of the field that contains the token-weight pairs to be searched against.
@@ -120,7 +120,7 @@ NOTE: The default values for `tokens_freq_ratio_threshold` and `tokens_weight_th
120120

121121
[discrete]
122122
[[sparse-vector-query-example]]
123-
=== Example ELSER query
123+
==== Example ELSER query
124124

125125
The following is an example of the `sparse_vector` query that references the ELSER model to perform semantic search.
126126
For a more detailed description of how to perform semantic search by using ELSER and the `sparse_vector` query, refer to <<semantic-search-elser,this tutorial>>.
@@ -241,7 +241,7 @@ GET my-index/_search
241241

242242
[discrete]
243243
[[sparse-vector-query-with-pruning-config-and-rescore-example]]
244-
=== Example ELSER query with pruning configuration and rescore
244+
==== Example ELSER query with pruning configuration and rescore
245245

246246
The following is an extension to the above example that adds a preview:[] pruning configuration to the `sparse_vector` query.
247247
The pruning configuration identifies non-significant tokens to prune from the query in order to improve query performance.

docs/reference/query-dsl/special-queries.asciidoc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ or collection of documents.
1717
This query finds queries that are stored as documents that match with
1818
the specified document.
1919

20-
<<query-dsl-knn-query,`knn` query>>::
21-
A query that finds the _k_ nearest vectors to a query
22-
vector, as measured by a similarity metric.
23-
2420
<<query-dsl-rank-feature-query,`rank_feature` query>>::
2521
A query that computes scores based on the values of numeric features and is
2622
able to efficiently skip non-competitive hits.
@@ -32,9 +28,6 @@ This query allows a script to act as a filter. Also see the
3228
<<query-dsl-script-score-query,`script_score` query>>::
3329
A query that allows to modify the score of a sub-query with a script.
3430

35-
<<query-dsl-semantic-query,`semantic` query>>::
36-
A query that allows you to perform semantic search.
37-
3831
<<query-dsl-wrapper-query,`wrapper` query>>::
3932
A query that accepts other queries as json or yaml string.
4033

@@ -50,20 +43,14 @@ include::mlt-query.asciidoc[]
5043

5144
include::percolate-query.asciidoc[]
5245

53-
include::knn-query.asciidoc[]
54-
5546
include::rank-feature-query.asciidoc[]
5647

5748
include::script-query.asciidoc[]
5849

5950
include::script-score-query.asciidoc[]
6051

61-
include::semantic-query.asciidoc[]
62-
6352
include::wrapper-query.asciidoc[]
6453

6554
include::pinned-query.asciidoc[]
6655

6756
include::rule-query.asciidoc[]
68-
69-
include::weighted-tokens-query.asciidoc[]

docs/reference/query-dsl/text-expansion-query.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[query-dsl-text-expansion-query]]
2-
== Text expansion query
2+
=== Text expansion query
33

44
++++
55
<titleabbrev>Text expansion</titleabbrev>
@@ -12,7 +12,7 @@ The text expansion query uses a {nlp} model to convert the query text into a lis
1212

1313
[discrete]
1414
[[text-expansion-query-ex-request]]
15-
=== Example request
15+
==== Example request
1616

1717
[source,console]
1818
----
@@ -32,14 +32,14 @@ GET _search
3232

3333
[discrete]
3434
[[text-expansion-query-params]]
35-
=== Top level parameters for `text_expansion`
35+
==== Top level parameters for `text_expansion`
3636

3737
`<sparse_vector_field>`:::
3838
(Required, object) The name of the field that contains the token-weight pairs the NLP model created based on the input text.
3939

4040
[discrete]
4141
[[text-expansion-rank-feature-field-params]]
42-
=== Top level parameters for `<sparse_vector_field>`
42+
==== Top level parameters for `<sparse_vector_field>`
4343

4444
`model_id`::::
4545
(Required, string) The ID of the model to use to convert the query text into token-weight pairs.
@@ -84,7 +84,7 @@ NOTE: The default values for `tokens_freq_ratio_threshold` and `tokens_weight_th
8484

8585
[discrete]
8686
[[text-expansion-query-example]]
87-
=== Example ELSER query
87+
==== Example ELSER query
8888

8989
The following is an example of the `text_expansion` query that references the ELSER model to perform semantic search.
9090
For a more detailed description of how to perform semantic search by using ELSER and the `text_expansion` query, refer to <<semantic-search-elser,this tutorial>>.
@@ -208,7 +208,7 @@ GET my-index/_search
208208

209209
[discrete]
210210
[[text-expansion-query-with-pruning-config-and-rescore-example]]
211-
=== Example ELSER query with pruning configuration and rescore
211+
==== Example ELSER query with pruning configuration and rescore
212212

213213
The following is an extension to the above example that adds a preview:[] pruning configuration to the `text_expansion` query.
214214
The pruning configuration identifies non-significant tokens to prune from the query in order to improve query performance.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[[vector-queries]]
2+
== Vector queries
3+
4+
Vector queries are specialized queries that work on vector fields to efficiently perform <<semantic-search,semantic search>>.
5+
6+
<<query-dsl-knn-query,`knn` query>>::
7+
A query that finds the _k_ nearest vectors to a query vector for <<dense-vector,`dense_vector`>> fields, as measured by a similarity metric.
8+
9+
<<query-dsl-sparse-vector-query,`sparse_vector` query>>::
10+
A query used to search <<sparse-vector,`sparse_vector`>> field types.
11+
12+
<<query-dsl-semantic-query,`semantic` query>>::
13+
A query that allows you to perform semantic search on <<semantic-text,`semantic_text`>> fields.
14+
15+
[discrete]
16+
=== Deprecated vector queries
17+
18+
The following queries have been deprecated and will be removed in the near future.
19+
Use the <<query-dsl-sparse-vector-query,`sparse_vector` query>> query instead.
20+
21+
<<query-dsl-text-expansion-query,`text_expansion` query>>::
22+
A query that allows you to perform sparse vector search on <<sparse-vector,`sparse_vector`>> or <<rank-features,`rank_features`>> fields.
23+
24+
<<query-dsl-weighted-tokens-query,`weighted_tokens` query>>::
25+
Allows to perform text expansion queries optimizing for performance.
26+
27+
include::knn-query.asciidoc[]
28+
29+
include::sparse-vector-query.asciidoc[]
30+
31+
include::semantic-query.asciidoc[]
32+
33+
include::text-expansion-query.asciidoc[]
34+
35+
include::weighted-tokens-query.asciidoc[]
36+
37+

0 commit comments

Comments
 (0)