Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create double nested fields where one field value can be overriden by another field value in Solr?
    primarykey
    data
    text
    <p>I hope someone could help me in trying to flatten some tables for Solr with MySQL backend. </p> <p>Here is the ERD: <a href="http://img843.imageshack.us/img843/249/ja0h.png" rel="nofollow">ERD for products</a></p> <p>I have a product table that is linked to a content table and a market_content table for overriding content. Content in the sense of textual content. The product table references the content table by a foreign key to 'content.id' and the 'content.default_content' field shows the content related to the 'content.id'. The content can be overridden by the table market_content. If there is a corresponding id in the 'market_content.id' field that matches a record in 'content.id' then I want it to get content from the 'market_content.content' field instead of using 'content.default_content'.</p> <p>Content either from 'content.default_content' or 'market_content.content' is text such as “shampoo”, “shampoo with conditioner”.</p> <p>I am having trouble trying to get the structure to be as below on returning results from Solr as well as making sure that if there is an id in the market_content table that corresponds to an id in the content table, that Solr returns the overriding content from the market_content table 'market.content.content' field.</p> <p>What I would like is for the results to be structured like this:</p> <pre><code>ProductId:1 Market: GB: Content_id_description: shampoo US: Content_id_description: shampoo EU: Content_id_description: Shampoo with conditioner ProductId:2 Market: GB: Content_id_description: shampoo US: Content_id_description: shampoo EU: Content_id_description: shampoo </code></pre> <p>Product1; Market; EU; Content_id_description (content coming from the content table): was overridden to say “Shampoo with conditioner”.</p> <p>Is there anyway to get Solr to output in this structure and how would I go about flattening the ERD shown above to get the best optimised search on Solr?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload