I was trying to use scripted fields as described in the docs for the ultimate goal of using them in Kibana but I was unable to get them to work via curl. I tried adapting the query shown in the docs for my own setup/example but I was unable to get it to work as my response did not contain '_source' or 'doc'. I have source enabled and I did not disable doc values in my mapping.
I was wondering if someone could shed some light into getting script fields working.
I changed the query from the one on the documentation (to perform the search on an index) because if I did not do that, I would only get a response that includes the .kibana indices.
Query: curl -XGET 'localhost:9200/dns2/_search?pretty' -d' { "query" : { "match_all": {} }}'
I have an integer field called 'domain_name_length' so I suppose I can use the full example from the documentation but instead of 'my_field_name', I'll use 'domain_name_length'. Therefore, my query would be as follows:
It looks like the ' in the scripted field doc['domain_name_length'] must be correctly escaped when used with the curl tool, because curl also uses the ' as a delimiter for the request body.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.