Query WHERE on elasticsearch

0

I have this query in elasticsearch:

$query= $es->search([
                  'index' => 'juguetes',
                  'from' => $f,
                  'size' => 50,
                  'body'=>[
                    'query'=>[
                          'query_string'=>[
                            'fields'=>['nombre','almacen','categoria'],
                            'query'=>'"'.$q.'"'

                          ], 
                    ],
                    'sort'=>[
                        'precio'=>['order'=>'asc'],
                    ]
                  ]           
                ]);

The query is looking in the fields name, store and category until there works well, what I need is that the search can be done on a special category, as a kind of where I look for name and / or warehouse where category be = a something.

I'm using elasticsearch-php

Thanks for the help.

    
asked by Vacanito 01.06.2018 в 06:22
source

0 answers