lucene - Apache Solr one to many relationship mapping -
i have following configured in db-config.xml
<dataconfig> <datasource type="jdbcdatasource" driver="com.mysql.jdbc.driver" url="jdbc:mysql://host:port/schema" user="username" password="password" /> <document name="product"> <entity name="store" query="select mid,name,display_name,address,email,pincode,b.latitude,b.longitude,city,locality,b.lid,b.locid business b join locality loc on b.locid = loc.locid join location l on l.lid = loc.lid b.status='a' , isitemstore ='y' , mid between 11151 , 11161 "> <field column="mid" name="id"/> <field column="lid" name="lid"/> <field column="locid" name="locid"/> <field column="name" name="name"/> <field column="display_name" name="display_name"/> <field column="address" name="address"/> <field column="email" name="email"/> <field column="pincode" name="pincode"/> <field column="latitude" name="latitude"/> <field column="longitude" name="longitude"/> <field column="city" name="city"/> <field column="locality" name="locality"/> <entity name="item" query="select ib.cid,ib.bid,ib.item_id,b.bname,c.cname,ib.description,short_description, concat(field_1,' ',field_2,' ',field_3,' ',field_4,' ',field_5,' ',field_6) item_feature,inv.pos_code,sku_count,unit_price,final_price item_business ib join brand b on ib.bid = b.bid join category c on c.cid=ib.cid join `${store.mid}-inventory-table` inv ib.status='a'"> <field column="item_id" name="item_id"/> <field column="short_description" name="short_description"/> <field column="item_desc" name="item_desc"/> <field column="item_feature" name="item_feature"/> <field column="bid" name="bid"/> <field column="cid" name="cid"/> <field column="bname" name="brand_name" /> <field column="cname" name="category_name" /> <field column="pos_code" name="pos_code" /> <field column="sku_count" name="sku_count" /> <field column="unit_price" name="unit_price" /> <field column="final_price" name="final_price" /> </entity> </entity> </document> </dataconfig>
the below snippet have in schema.xml
<uniquekey>id</uniquekey> <field name="id" type="tlong" indexed="true" stored="true"/> <field name="name" type="text_general" indexed="true" stored="true"/> <field name="display_name" type="text_general" indexed="true" stored="true"/> <field name="address" type="text_general" indexed="true" stored="true"/> <field name="email" type="text_general" indexed="true" stored="true"/> <field name="pincode" type="text_general" indexed="true" stored="true"/> <field name="latitude" type="tdouble" indexed="true" stored="true"/> <field name="longitude" type="tdouble" indexed="true" stored="true"/> <field name="city" type="text_general" indexed="true" stored="true"/> <field name="locality" type="text_general" indexed="true" stored="true"/> <field name="item_id" type="tlong" indexed="true" stored="true"/> <field name="bname" type="text_general" indexed="true" stored="true"/> <field name="cname" type="text_general" indexed="true" stored="true"/> <field name="item_feature" type="text_general" indexed="true" stored="true"/> <field name="item_desc" type="text_general" indexed="true" stored="true"/> <field name="short_description" type="text_general" indexed="true" stored="true"/> <field name="pos_code" type="text_general" indexed="true" stored="true"/> <field name="sku_count" type="tint" indexed="true" stored="true"/> <field name="unit_price" type="tdouble" indexed="true" stored="true"/> <field name="final_price" type="tdouble" indexed="true" stored="true"/>
solrconfig.xml
<lib dir="../../../dist/" regex="solr-dataimporthandler-\d.*\.jar" /> <requesthandler name="/dataimport" class="org.apache.solr.handler.dataimport.dataimporthandler"> <lst name="defaults"> <str name="config">db-data-config.xml</str> </lst> </requesthandler
i beginner in apache solr. , followed solr wiki server , running jetty server.
scenario : store has items , items have attributes.
i store information , store items store has.
but indexing happens 1 store , 1 item instead of 1 store , items in 1 store.
how second query in db-config.xml run multiple times fetch items store?
and see there multi-value option, not sure how use in context.
can 1 help?
Comments
Post a Comment