rjurney / Agile_Data_Code_2

Code for Agile Data Science 2.0, O'Reilly 2017, Second Edition
http://bit.ly/agile_data_science
MIT License
456 stars 306 forks source link

Painless script with elastic search #100

Closed ameet20 closed 5 years ago

ameet20 commented 5 years ago

Script query allows us to execute a script on each document. Script queries are usually used in filter context. When you want to have a script in the query or filter context, make sure you embed the script in a script object ( “script” :{}). Hence in the below example you would see script tag within a script tag.

Let’s try it out with an example. Let’s find out all the tweets that contains string “painless” and has a length greater than 25 characters.

rjurney commented 5 years ago

Thanks!