Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapping = {
- "my_index": {
- "date_detection": False,
- "dynamic_templates": [{
- "string_fields": {
- "mapping": {
- "type": "string",
- "fields": {
- "raw": {
- "index": "not_analyzed",
- "ignore_above": 256,
- "type": "string"
- }
- }
- },
- "match_mapping_type": "string",
- "match": "*"
- }
- }]
- }
- }
- records = es.search(index="my_index",doc_type="marksheet",body={ "aggs": { "student_name": { "terms": { "field": "name.raw","order": { "total_score" : "desc" } }, "aggs": { "total_score": { "sum": { "field": "score" } } } } } } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement