Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 27e1a18

Browse files
[Backport master] Add support for dense vector field (#5782)
* Add support for dense vector fields (#5780) (cherry picked from commit 94be96e) * Fix namespace * Update docs gen * Update docs
1 parent 81fb694 commit 27e1a18

File tree

21 files changed

+452
-149
lines changed

21 files changed

+452
-149
lines changed

‎docs/client-concepts/high-level/mapping/fluent-mapping.asciidoc‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ var createIndexResponse = _client.Indices.Create("myindex", c => c
405405
"birthDayOfWeek": {
406406
"type": "keyword",
407407
"script": {
408-
"lang": "painless",
409408
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
410409
}
411410
}
@@ -427,3 +426,38 @@ createIndexResponse = _client.Indices.Create("myindex", c => c
427426
);
428427
----
429428

429+
One may also include and use parameters in the script.
430+
431+
[source,csharp]
432+
----
433+
createIndexResponse = _client.Indices.Create("myindex", c => c
434+
.Map<Company>(m => m
435+
.RuntimeFields(rtf => rtf
436+
.RuntimeField("birthDayOfWeek", FieldType.Keyword, f => f
437+
.Script(s => s
438+
.Source("emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT) + params.suffix)")
439+
.Params(p => p.Add("suffix", " with a suffix."))
440+
)))
441+
)
442+
);
443+
----
444+
445+
[source,javascript]
446+
----
447+
{
448+
"mappings": {
449+
"runtime": {
450+
"birthDayOfWeek": {
451+
"type": "keyword",
452+
"script": {
453+
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT) + params.suffix)",
454+
"params": {
455+
"suffix": " with a suffix."
456+
}
457+
}
458+
}
459+
}
460+
}
461+
}
462+
----
463+

‎docs/query-dsl.asciidoc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ NEST exposes all of the full text queries available in Elasticsearch
4545

4646
:anchor-list: query-dsl/full-text
4747

48+
* <<combined-fields-usage,Combined Fields Usage>>
49+
4850
* <<common-terms-usage,Common Terms Usage>>
4951

5052
* <<intervals-usage,Intervals Usage>>
@@ -67,6 +69,8 @@ See the Elasticsearch documentation on {ref_current}/full-text-queries.html[Full
6769

6870
:includes-from-dirs: query-dsl/full-text
6971

72+
include::query-dsl/full-text/combined-fields/combined-fields-usage.asciidoc[]
73+
7074
include::query-dsl/full-text/common-terms/common-terms-usage.asciidoc[]
7175

7276
include::query-dsl/full-text/intervals/intervals-usage.asciidoc[]
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/master
2+
3+
:github: https://github.com/elastic/elasticsearch-net
4+
5+
:nuget: https://www.nuget.org/packages
6+
7+
////
8+
IMPORTANT NOTE
9+
==============
10+
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/master/src/Tests/Tests/QueryDsl/FullText/CombinedFields/CombinedFieldsUsageTests.cs.
11+
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
12+
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
13+
////
14+
15+
[[combined-fields-usage]]
16+
=== Combined Fields Usage
17+
18+
The `combined_fields` query supports searching multiple text fields as if their contents had been indexed into one combined field. It takes a
19+
term-centric view of the query: first it analyzes the query string into individual terms, then looks for each term in any of the fields.
20+
21+
See the Elasticsearch documentation on {ref_current}/query-dsl-combined-fields-query.html[combined fields query] for more details.
22+
23+
==== Fluent DSL example
24+
25+
[source,csharp]
26+
----
27+
q
28+
.CombinedFields(c => c
29+
.Fields(f => f.Field(p => p.Description).Field("myOtherField"))
30+
.Query("hello world")
31+
.Boost(1.1)
32+
.Operator(Operator.Or)
33+
.MinimumShouldMatch("2")
34+
.ZeroTermsQuery(ZeroTermsQuery.All)
35+
.Name("combined_fields")
36+
.AutoGenerateSynonymsPhraseQuery(false)
37+
)
38+
----
39+
40+
==== Object Initializer syntax example
41+
42+
[source,csharp]
43+
----
44+
new CombinedFieldsQuery
45+
{
46+
Fields = Field<Project>(p => p.Description).And("myOtherField"),
47+
Query = "hello world",
48+
Boost = 1.1,
49+
Operator = Operator.Or,
50+
MinimumShouldMatch = "2",
51+
ZeroTermsQuery = ZeroTermsQuery.All,
52+
Name = "combined_fields",
53+
AutoGenerateSynonymsPhraseQuery = false
54+
}
55+
----
56+
57+
[source,javascript]
58+
.Example json output
59+
----
60+
{
61+
"combined_fields": {
62+
"_name": "combined_fields",
63+
"boost": 1.1,
64+
"query": "hello world",
65+
"minimum_should_match": "2",
66+
"operator": "or",
67+
"fields": [
68+
"description",
69+
"myOtherField"
70+
],
71+
"zero_terms_query": "all",
72+
"auto_generate_synonyms_phrase_query": false
73+
}
74+
}
75+
----
76+
77+
[float]
78+
=== Combined fields with boost usage
79+
80+
==== Fluent DSL example
81+
82+
[source,csharp]
83+
----
84+
q
85+
.CombinedFields(c => c
86+
.Fields(Field<Project>(p => p.Description, 2.2).And("myOtherField^1.2"))
87+
.Query("hello world")
88+
)
89+
----
90+
91+
==== Object Initializer syntax example
92+
93+
[source,csharp]
94+
----
95+
new CombinedFieldsQuery
96+
{
97+
Fields = Field<Project>(p => p.Description, 2.2).And("myOtherField^1.2"),
98+
Query = "hello world",
99+
}
100+
----
101+
102+
[source,javascript]
103+
.Example json output
104+
----
105+
{
106+
"combined_fields": {
107+
"query": "hello world",
108+
"fields": [
109+
"description^2.2",
110+
"myOtherField^1.2"
111+
]
112+
}
113+
}
114+
----
115+

‎docs/query-dsl/geo/bounding-box/geo-bounding-box-query-usage.asciidoc‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ q
2929
.BottomRight(-34, 34)
3030
)
3131
.ValidationMethod(GeoValidationMethod.Strict)
32-
.Type(GeoExecution.Indexed)
3332
)
3433
----
3534

@@ -47,7 +46,6 @@ new GeoBoundingBoxQuery
4746
TopLeft = new GeoLocation(34, -34),
4847
BottomRight = new GeoLocation(-34, 34),
4948
},
50-
Type = GeoExecution.Indexed,
5149
ValidationMethod = GeoValidationMethod.Strict
5250
}
5351
----
@@ -57,7 +55,6 @@ new GeoBoundingBoxQuery
5755
----
5856
{
5957
"geo_bounding_box": {
60-
"type": "indexed",
6158
"validation_method": "strict",
6259
"_name": "named_query",
6360
"boost": 1.1,
@@ -88,7 +85,6 @@ q
8885
.WellKnownText("BBOX (-34, 34, 34, -34)")
8986
)
9087
.ValidationMethod(GeoValidationMethod.Strict)
91-
.Type(GeoExecution.Indexed)
9288
)
9389
----
9490

@@ -105,7 +101,6 @@ new GeoBoundingBoxQuery
105101
{
106102
WellKnownText = "BBOX (-34, 34, 34, -34)"
107103
},
108-
Type = GeoExecution.Indexed,
109104
ValidationMethod = GeoValidationMethod.Strict
110105
}
111106
----
@@ -115,7 +110,6 @@ new GeoBoundingBoxQuery
115110
----
116111
{
117112
"geo_bounding_box": {
118-
"type": "indexed",
119113
"validation_method": "strict",
120114
"_name": "named_query",
121115
"boost": 1.1,

‎docs/search/request/search-after-usage.asciidoc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ s => s
3636

3737
[source,csharp]
3838
----
39-
new SearchRequest<Project>
39+
new SearchRequest<Project>()
4040
{
4141
Sort = new List<ISort>
4242
{
@@ -92,7 +92,7 @@ s => s
9292

9393
[source,csharp]
9494
----
95-
new SearchRequest<Project>
95+
new SearchRequest<Project>()
9696
{
9797
Sort = new List<ISort>
9898
{

‎docs/search/searching-runtime-fields.asciidoc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ which yields the following query JSON
114114
"runtime_mappings": {
115115
"search_runtime_field": {
116116
"script": {
117-
"lang": "painless",
118117
"source": "if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}"
119118
},
120119
"type": "keyword"
@@ -139,7 +138,7 @@ var searchRequest = new SearchRequest<Project>
139138
{ "search_runtime_field", new RuntimeField
140139
{
141140
Type = FieldType.Keyword,
142-
Script = new PainlessScript("if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}")
141+
Script = new InlineScript("if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}")
143142
}
144143
}
145144
}

‎src/Nest/Indices/MappingManagement/GetMapping/GetMappingResponse.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void Accept(IMappingVisitor visitor)
2424

2525
public class IndexMappings
2626
{
27-
[Obsolete("Mapping are no longer grouped by type, this indexer is ignored and simply returns Mapppings")]
27+
[Obsolete("Mapping are no longer grouped by type, this indexer is ignored and simply returns Mappings")]
2828
public TypeMapping this[string type] => Mappings;
2929

3030
[DataMember(Name = "mappings")]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /