@@ -19,51 +19,18 @@ The method expects an object with the following mandatory properties:
1919
2020* the match query object
2121
22- Here is an example search request:
23- ```
24- {
25- 'index':'movies',
26- 'query':
27- {
28- 'bool':
29- {
30- 'must':
31- [
32- {'query_string':' movie'}
33- ]
34- }
35- },
36- 'script_fields':
37- {
38- 'myexpr':
39- {
40- 'script':
41- {
42- 'inline':'IF(rating>8,1,0)'
43- }
44- }
45- },
46- 'sort':
47- [
48- {'myexpr':'desc'},
49- {'_score':'desc'}
50- ],
51- 'profile':true
52- }
53- ```
54-
5522For details, see the documentation on [ ** SearchRequest** ] ( SearchRequest.md )
5623
5724The method returns an object with the following properties:
5825
59- - took: the time taken to execute the search query.
60- - timed_out: a boolean indicating whether the query timed out.
6126- hits: an object with the following properties:
62- - total: the total number of hits found.
6327 - hits: an array of hit objects, where each hit object represents a matched document. Each hit object has the following properties:
6428 - _ id: the ID of the matched document.
6529 - _ score: the score of the matched document.
6630 - _ source: the source data of the matched document.
31+ - total: the total number of hits found.
32+ - timed_out: a boolean indicating whether the query timed out.
33+ - took: the time taken to execute the search query.
6734
6835In addition, if profiling is enabled, the response will include an additional array with profiling information attached.
6936
@@ -174,7 +141,17 @@ Expects two parameters: the index name and an object with an array of documents
174141An example of the documents object:
175142
176143```
177- {"query":{"percolate":{"document":{"content":"sample content"}}}}
144+ {"query":
145+ {
146+ "percolate":
147+ {
148+ "document":
149+ {
150+ "content":"sample content"
151+ }
152+ }
153+ }
154+ }
178155```
179156
180157Responds with an object with matched stored queries:
0 commit comments