A
A
Alexander2017-10-26 11:30:21
elasticsearch
Alexander, 2017-10-26 11:30:21

What type of data?

Essence of a question: There is a field ' paid_promo ' in it the date in UNIX TIME format ( 1508904244 ) is stored. I do sorting on ElasticSearch:

'_script' => [
                'type' => 'date',
                'script'  => "if(doc['payed_promo'].value > 1508904244 ) doc['payed_promo'].value",
                'order' => 'desc'
            ],

It gives me an error: failed to parse field [type]
How to fix it? What data type to set?
UPD:
As I understand it, there is only a type: number or string, if so, then another error occurs:
{"error":{"root_cause":[{"type":"null_pointer_exception","reason":null}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"services","node":"qWnjNlxwTAOgCizNse3Gyg","reason":{"type":"null_pointer_exception","reason":null}}]},"status":500}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question