File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
docs/reference/index-modules Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -326,7 +326,18 @@ Which yields:
326
326
// TESTRESPONSE[s/"took": 12/"took" : $body.took/]
327
327
// TESTRESPONSE[s/OzrdjxNtQGaqs4DmioFw9A/$body.hits.hits.0._node/]
328
328
329
- You might have noticed that a significant part of the script depends on
329
+ WARNING: While scripted similarities provide a lot of flexibility, there is
330
+ a set of rules that they need to satisfy. Failing to do so could make
331
+ Elasticsearch silently return wrong top hits or fail with internal errors at
332
+ search time:
333
+
334
+ - Returned scores must be positive.
335
+ - All other variables remaining equal, scores must not decrease when
336
+ `doc.freq` increases.
337
+ - All other variables remaining equal, scores must not increase when
338
+ `doc.length` increases.
339
+
340
+ You might have noticed that a significant part of the above script depends on
330
341
statistics that are the same for every document. It is possible to make the
331
342
above slightly more efficient by providing an `weight_script` which will
332
343
compute the document-independent part of the score and will be available
@@ -491,7 +502,6 @@ GET /index/_search?explain=true
491
502
492
503
////////////////////
493
504
494
-
495
505
Type name: `scripted`
496
506
497
507
[float]
You can’t perform that action at this time.
0 commit comments