Friday, 15 March 2013

elasticsearch returning unique values -


I have a field named 'category'.

I can only return the list of possible categories:

  $ searchParam ['body'] ['ags'] ['category'] [ 'Terms'] ['Field'] = 'Category';  

But I want to search within that area and return only the categories that match my query.

Example list:

  1. Pizza
  2. Apple pie
  3. Cupcake
  4. Burger
  5. I want to find "pie" and the following results:

    1. Apple pie
    2. Orange pie

    There are more than 200 categories

    thanks for all help :)

Aggregation, so if you execute a search query for "pie" , then aggregation will only see (and gross) "pie" documents.

  ['category' => 'pie']], 'ags' => gt; ; ['Category' = & gt; ['Rule' = & gt; ['Field' = & gt; 'Square']]]]]; $ Result = $ Client-> Search ($ query); < / Code> 

No comments:

Post a Comment