IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Arrays of empty objects
editArrays of empty objects
editOccasionally, you’ll encounter DSL that requires both of the previous patterns. The function score query is a good example, it sometimes requires an array of objects, and some of those objects might be empty JSON objects.
Given this query:
{ "query":{ "function_score":{ "functions":[ { "random_score":{} } ], "boost_mode":"replace" } } }
We can build it using the following PHP code: