Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def do_QUERY(self, queryString, queryOperator):
- queryString = queryString.replace('"', '').replace("'", '')
- ESR = {
- "aggs": {
- "params": {
- "terms": {
- "field": "category",
- "size": 100
- }
- }
- },
- "query": {
- "bool": {
- "must": {
- "script": {
- "script": {
- "inline": "(doc.draft.value == 'no' && doc.category.value QUERYOPERATOR QUERYSTRING)",
- "lang": "javascript"
- }
- }
- }
- }
- }
- }
- ESR_updated = json.dumps(ESR).replace('QUERYSTRING', '\u0027' + queryString + '\u0027').replace('QUERYOPERATOR', queryOperator)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement