title: ElasticSearch in e-commerce: multiple categories for a product
body: <p>How do you index products like that in ElasticSearch? We've separated all documents based on the attributes (colour, brand, size, whatever users input), but all of them belong to a set of categories. May be one, may be 15. </p>
  
  <pre><code>        [0] =&gt; Array
              (
                  [product_id] =&gt; 123456
                  [product_name] =&gt; Shirt 1
                  [filter_name] =&gt; Colour
                  [filter_value] =&gt; Blue
                  [product_parent_id] =&gt; 111111
                  [product_has_discount] =&gt; 0
                  [product_price] =&gt; 19.99
                  [product_stock] =&gt; 1
              )
          [1] =&gt; Array
              (
                  [product_id] =&gt; 123457
                  [product_name] =&gt; Shirt 1
                  [filter_name] =&gt; Colour
                  [filter_value] =&gt; Red
                  [product_parent_id] =&gt; 111111
                  [product_has_discount] =&gt; 0
                  [product_price] =&gt; 19.99
                  [product_stock] =&gt; 1
              )
  </code></pre>
  
  <p>How would we tag categories into this? Would it be so simple as saying</p>
  
  <pre><code>        [product_categories] =&gt; ;4750;4834;4835;4836;
  </code></pre>
  
  <p>And then querying ElasticSearch with <code>match against category</code> with the value <code>;4836;</code>? Is that possible? Recommended?</p>