You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -259,7 +262,7 @@ In OpenSearch, if you want to retrieve doc values for nested objects, you cannot
259
262
1. Define the index mappings:
260
263
261
264
```json
262
-
PUT my_index
265
+
PUT /my_index
263
266
{
264
267
"mappings": {
265
268
"properties": {
@@ -282,7 +285,7 @@ In OpenSearch, if you want to retrieve doc values for nested objects, you cannot
282
285
2. Index your data:
283
286
284
287
```json
285
-
POST my_index/_doc/1
288
+
POST /my_index/_doc/1
286
289
{
287
290
"title": "OpenSearch Basics",
288
291
"author": "John Doe",
@@ -305,7 +308,7 @@ In OpenSearch, if you want to retrieve doc values for nested objects, you cannot
305
308
3. Perform a search with `inner_hits` and `docvalue_fields`:
306
309
307
310
```json
308
-
POST my_index/_search
311
+
POST /my_index/_search
309
312
{
310
313
"query": {
311
314
"nested": {
@@ -405,7 +408,7 @@ Unlike `_source`, `stored_fields` must be explicitly defined in the mappings for
405
408
1. Create an index with the following mappings:
406
409
407
410
```json
408
-
PUT my_index
411
+
PUT /my_index
409
412
{
410
413
"mappings": {
411
414
"properties": {
@@ -432,14 +435,17 @@ Unlike `_source`, `stored_fields` must be explicitly defined in the mappings for
432
435
2. Index your data:
433
436
434
437
```json
435
-
POST my_index/_doc/1
438
+
POST /my_index/_doc/1
436
439
{
437
440
"title": "OpenSearch Basics",
438
441
"author": "John Doe",
439
442
"publication_date": "2022-01-01",
440
443
"price": 29.99
441
444
}
445
+
```
446
+
{% include copy-curl.html %}
442
447
448
+
```json
443
449
POST my_index/_doc/2
444
450
{
445
451
"title": "Advanced OpenSearch",
@@ -453,7 +459,7 @@ Unlike `_source`, `stored_fields` must be explicitly defined in the mappings for
453
459
3. Perform a search with `stored_fields`:
454
460
455
461
```json
456
-
POST my_index/_search
462
+
POST /my_index/_search
457
463
{
458
464
"_source": false,
459
465
"stored_fields": ["title", "author"],
@@ -508,7 +514,7 @@ In OpenSearch, if you want to retrieve `stored_fields` for nested objects, you c
508
514
1. Create an index with the following mappings:
509
515
510
516
```json
511
-
PUT my_index
517
+
PUT /my_index
512
518
{
513
519
"mappings": {
514
520
"properties": {
@@ -531,7 +537,7 @@ In OpenSearch, if you want to retrieve `stored_fields` for nested objects, you c
531
537
2. Index your data:
532
538
533
539
```json
534
-
POST my_index/_doc/1
540
+
POST /my_index/_doc/1
535
541
{
536
542
"title": "OpenSearch Basics",
537
543
"author": "John Doe",
@@ -554,7 +560,7 @@ In OpenSearch, if you want to retrieve `stored_fields` for nested objects, you c
554
560
3. Perform a search with `inner_hits` and `stored_fields`:
555
561
556
562
```json
557
-
POST my_index/_search
563
+
POST /my_index/_search
558
564
{
559
565
"_source": false,
560
566
"query": {
@@ -641,7 +647,7 @@ You can include or exclude specific fields from the `_source` field in the searc
641
647
1. Index your data:
642
648
643
649
```json
644
-
PUT my_index/_doc/1
650
+
PUT /my_index/_doc/1
645
651
{
646
652
"title": "OpenSearch Basics",
647
653
"author": "John Doe",
@@ -654,7 +660,7 @@ You can include or exclude specific fields from the `_source` field in the searc
654
660
2. Perform a search using source filtering:
655
661
656
662
```json
657
-
POST my_index/_search
663
+
POST /my_index/_search
658
664
{
659
665
"_source": ["title", "author"],
660
666
"query": {
@@ -694,7 +700,7 @@ The following is the expected response:
694
700
You can choose to exclude fields by using the `"excludes"` parameter in a search request, as shown in the following example:
695
701
696
702
```json
697
-
POST my_index/_search
703
+
POST /my_index/_search
698
704
{
699
705
"_source": {
700
706
"excludes": ["price"]
@@ -854,26 +860,26 @@ If you have an index of products, where each product document contains the `pric
854
860
855
861
2. Use the `script_fields` parameter to include a custom field called `discounted_price` in the search results. This field will be calculated based on the `price` and `discount_percentage` fields using a script:
0 commit comments