2 different tables no relationship
Data-config.xml:
<document> <entity name="topic" transformer="TemplateTransformer" pk="topic_id" query="select topic_id,topic_title,creation_date,updation_date,vote_count,....."> <field column=" doc_id " template="TOPIC_${topic.topic_id} " /> <field column="doc_type " template="TOPIC " /> </entity> <entity name="product " transformer="TemplateTransformer " pk="product_id " query="SELECT product_id,..... "> <field column="doc_id " template="PRODUCT_${product.product_id} " /> <field column="doc_type " template="PRODUCT " /> <field column="product_supplier_id " name="product_supplier_id " /> <field column="supplier_product_code " name="supplier_product_code " /> <field column="product_display_name " name="product_display_name " /> </entity> </document>
schema.xml:
<schema> . . . <fields> <field name="doc_id" type="string" /> <field name="doc_type" type="string" /> <field name="catchall" type="string" stored="false" omitNorms="true" multiValued="true" /> <field name="topic_title" type="text_general" />. . . . </fields> <uniqueKey>doc_id</uniqueKey> <copyField source="*" dest="catchall" /> <!-- field for the QueryParser to use when an explicit fieldname is absent --> <defaultSearchField>catchall</defaultSearchField> </schema>
Additional information - http://www.lucidimagination.com/blog/2011/02/12/solr-powered-isfdb-part-4/
there should not be a field above or there may be a problem with indexing
you can request a browser, for example http://localhost:8080/solr/select/?q=*:*&fq=doc_type:PRODUCT
Rastogi shobhit
source share