xml - How to index and search two different tables which are in same datasource using single solr instance(two different search fields no joins) -


i new solr. have couple of questions on solr indexing , searching:

  1. can configure index 2 tables( no relationship 1. books , 2. computers , both in same datasource) if want have 2 search boxes. possible defining 2 entities in 1 data-config.xml

if yes please let me know steps.

i guess can using 2 different data-config.xml files. need know how configure in schema.xml , corresponding changes.

  1. how configure solr index both pdf files , mysql on 1 solr instance.

please me out , let know if there reference documents.

2 different tables no relation

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 queryparser use when explicit fieldname absent -->         <defaultsearchfield>catchall</defaultsearchfield>     </schema> 

more info -http://www.lucidimagination.com/blog/2011/02/12/solr-powered-isfdb-part-4/

no above field should required or may create problem while indexing

you can query on browser http://localhost:8080/solr/select/?q=*:*&fq=doc_type:product


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -