title: solr schema design for many to many entity definitions
body: <p>I am trying to design a schema for a scenarios where there is a Many to Many relation between Products and Supplier. Search can be done from product centric way or supplier centric way. A product can be supplied by many Supplier and Supplier will have many product. Following is the solution I am thinking, but it seems like there is lot of redundancy in field definitions, do I need 2 entity definitions to support Product or Supplier centric searches. Does not look optimum.</p>
  
  <p>When doing a search for a Supplier, "product" can be defined "multiValue=true" When doing a search for a product, "supplier" can be defined "multiValue=true"</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!-- Field definitions to support supplier search --&gt;
  &lt;field name="s_supplier" type="string" indexed="true" stored="true" &gt;
  &lt;field name="s_product"  type="string" indexed="true" stored="true" multiValue="true"&gt;
  
  &lt;!-- Field definition to support product search --&gt;
  &lt;field name="p_product"  type="string" indexed="true" stored="true" &gt;
  &lt;field name="p_supplier"  type="string" indexed="true" stored="true" multiValue="true"&gt;
  </code></pre>
  
  <p>entity definition in datahandler is </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;entity name="products" ....&gt;
     &lt;field name="p_product" column=""&gt;
     &lt;entity name="suppliers"&gt;
        &lt;field name="p_supplier"&gt;
      &lt;/entity&gt;
  &lt;/entity&gt;
  
  &lt;entity name="suppliers" ....&gt;
     &lt;field name="s_supplier" column=""&gt;
     &lt;entity name="products"&gt;
        &lt;field name="s_product" column=""&gt;
      &lt;/entity&gt;
  &lt;/entity&gt;
  </code></pre>