Weird mappings to index for array of numeric ranges


(Mykola Borysiuk) #1

Hi.

I have two arrays with numbers in ranges called ageRange and householdIncomeRange.

For age range we can have values like [null, 17], [18,24], [25,34]...[65,null].

For household Income we can have values like [null, 14999], [15000, 24999], [25000, 34999], [35000, 49999], [50000, 74999]...[200000, 249999], [250000, null].

Now when i try to add those values into index i get very weird results in mapped fields.

For age range after aggregation i get keys like this :
< 17 , 18-24, 25-34, ... 65+.

For household Income i get keys like this :
0 for [null, 14999], 1 for [15000, 24999], 2 for[25000, 34999] , 3, ... , 11 for [250000, null] ..

Here is how its mapped in GET _mapping/

"ageRange": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }

householdIncomeRange": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }

Elastic search version 5.6

So my question is..How in the hell does it transforms ageRange into string joined by - , and household Income into numbers(what looks like to me as indexes of first elements in array).

Thank you.


(Mykola Borysiuk) #2

To make it even more weird. If i add to age ranges new set of values that are more than 999 for example [1001, 1005].

I will get in aggregation keys like this:
<17, 18-24, 25,34,...65+, 1001, 1005 ?? WTF really?

Is elastic search being smart and try to map those fields on background some how with pattern?


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.