Facet Term with multi field


(vgross) #1

Hi !
I have a problem concerning facets, my mapping for my field "tailles" is :

'tailles'       : {
    'properties'    :{
        'id'    : {'type' : 'integer', 'include_in_all' : FALSE},
        'nom'   : {
            'type' : 'multi_field', 
            'fields' : {
                'nom' : {
                    'type' : 'string', 
                },
                'untouched' : {
                    'type' : 'string',
                    'index' : 'not_analyzed',
                    'include_in_all' : FALSE
                }                
            }
        }
    }
}

When i apply a facet term with multi-field (tailles.nom.untouched et
tailles.id), Facet return for any field, the "term" and the count on it,
but they are more doublons because tailles.nom.untouched corresponding at
one tailles.id. This facet return me 2 same results.
For give an exemple : for one tailles "XL" with id "3" (id for the tailles)
if 4 product corresponding at my query, the facet return :

               [0] => Array
                    (
                        [term] => XL
                        [count] => 4
                    )

                [1] => Array
                    (
                        [term] => 3
                        [count] => 4
                    )

So, I want to have this data in the same array like this :

               [0] => Array
                    (
                        [term.nom] => XL

                        [term.id] => 3
                        [count] => 4
                    )

It's possible to do that with elastic search ?


(system) #2