Created
October 17, 2011 16:09
-
-
Save imotov/1292966 to your computer and use it in GitHub Desktop.
Return only first 100 characters of the field message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET 'http://localhost:9200/twitter/tweet/_search' -d '{ | |
"query": { | |
"query_string" : { | |
"query" : "*:*" | |
} | |
}, | |
"script_fields" : { | |
"short_message" : { | |
"script" : "msg = doc.message; msg.empty ? msg.stringValue : msg.stringValue.substring(0,min(100,msg.stringValue.length()))" | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment