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 @@ -341,7 +341,18 @@ Which yields:
341
341
// TESTRESPONSE[s/"took": 12/"took" : $body.took/]
342
342
// TESTRESPONSE[s/OzrdjxNtQGaqs4DmioFw9A/$body.hits.hits.0._node/]
343
343
344
- You might have noticed that a significant part of the script depends on
344
+ WARNING: While scripted similarities provide a lot of flexibility, there is
345
+ a set of rules that they need to satisfy. Failing to do so could make
346
+ Elasticsearch silently return wrong top hits or fail with internal errors at
347
+ search time:
348
+
349
+ - Returned scores must be positive.
350
+ - All other variables remaining equal, scores must not decrease when
351
+ `doc.freq` increases.
352
+ - All other variables remaining equal, scores must not increase when
353
+ `doc.length` increases.
354
+
355
+ You might have noticed that a significant part of the above script depends on
345
356
statistics that are the same for every document. It is possible to make the
346
357
above slightly more efficient by providing an `weight_script` which will
347
358
compute the document-independent part of the score and will be available
@@ -506,7 +517,6 @@ GET /index/_search?explain=true
506
517
507
518
////////////////////
508
519
509
-
510
520
Type name: `scripted`
511
521
512
522
[float]
You can’t perform that action at this time.
0 commit comments