Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by ShalinMangar: http://wiki.apache.org/solr/DataImportHandler The comment on the change is: Completed note on data-config.xml ------------------------------------------------------------------------------ }}} - Here, the root entity is a table called "item" whose primary key is a column "id". Data can be read from this table with the query "select * from item". - TODO: Further description + Here, the root entity is a table called "item" whose primary key is a column "id". Data can be read from this table with the query "select * from item". Each item can have multiple "features" which are in the table ''feature'' inside the column ''description''. Note the query in ''feature'' entity: + {{{ + <entity name="feature" + query="select description from feature where item_id='${item.id}'"> + <field name="feature" column="description" type="text" indexed="true" stored="true" multiValued="true"/> + </entity> + }}} + The ''item_id'' foreign key in feature table is joined together with ''id'' primary key in ''item'' to retrieve rows for each row in ''item''. In a similar fashion, we join ''item'' and 'category' (which is a many-to-many relationship). Notice how we join these two tables using the intermediate table ''item_category'' again using templated SQL. + {{{ + <entity name="item_category" + query="select category_id from item_category where item_id='${item.id}'"> + <entity name="category" + query="select description from category where id = '${item_category.category_id}'"> + <field column="description" name="cat" type="text_ws" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true" /> + </entity> + </entity> + }}} + + '''NOTE''' + * The data-config in this example can also be written with only one entity ''item'' using SQL joins. In that case columns in ''category'' and ''feature'' tables can directly be read from the ''item'' entity. + * This example schema does not use the delta features. We will add more examples soon. + + == Using create-schema command == + TODO + + == Using full-import command == + TODO + + == Using delta-import command == + TODO + + We hope to expand this documentation even more by adding more and more examples showing off the power of this tool. Keep checking back. ---- CategorySolrRequestHandler
