1

This is an example of a mapping we have in ES:

mapping = {
    'settings': {
        'number_of_shards': 1,
        'number_of_replicas': 0,
    },
    'mappings': {
        '_doc': {
            'properties': {
                'cat': {
                    'type': 'keyword',
                }
            }
        }
    }
}

We indexed some rows for testing using Python:

es.index('test_ind', '_doc', body={'cat': 'cat1,cat2,cat3'})
es.index('test_ind', '_doc', body={'cat': 'cat1,cat2,cat4'})

So I tried running some terms bucket aggregation by running a split operation on the cat field:

facet = {                                                                 
    "_source": ["cat"],
    "aggs": {
        "test": {
            "terms": {
                "script": {
                    "source": "doc['cat'].value.split(',')[0]",
                }
            }
        }
    }
}

r = es.search('test_ind', '_doc', body=facet)

But this raises the error:

TransportError: TransportError(500, 'search_phase_execution_exception', 'runtime error')

In ES logs I can see this message:

2018-04-29T06:20:39.871+0000: 137707.242: Total time for which application threads were stopped: 0.0077604 seconds, Stopping threads took: 0.0000672 seconds
2018-04-29T06:21:29.949+0000: 137757.320: [GC (Allocation Failure) 2018-04-29T06:21:29.949+0000: 137757.320: [ParNew
Desired survivor size 17432576 bytes, new threshold 6 (max 6)
- age   1:    4312504 bytes,    4312504 total
- age   2:     613880 bytes,    4926384 total
- age   3:       3088 bytes,    4929472 total
- age   4:       1536 bytes,    4931008 total
- age   5:      20752 bytes,    4951760 total
- age   6:       2576 bytes,    4954336 total
: 276935K->5314K(306688K), 0.0061500 secs] 757743K->486122K(1014528K), 0.0062660 secs] [Times: user=0.02 sys=0.00, real=0.00 secs] 

Why it won't accept the split operation? Is there anything wrong in our setup?

Willian Fuks
  • 11,259
  • 10
  • 50
  • 74
  • Can you show the full error? – Val Apr 29 '18 at 03:55
  • Hi @Val, just edited my question with the full stack trace. If you need any more information just let me know :)! Tnx – Willian Fuks Apr 29 '18 at 06:05
  • Yes, I need the stack trace that you can see in the ES logs. That one is from the Python side and isn't of much help – Val Apr 29 '18 at 06:08
  • @Val sure, just added as well. I'm using a docker image with ES version 6.2. Got this log message directly in `/docs/gc.log.0.current`. That's the only log message in the file. – Willian Fuks Apr 29 '18 at 06:27

0 Answers0