lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jawedshamshedi <jawedshamsh...@gmail.com>
Subject Create index on two unrelated table in Solr
Date Fri, 18 Nov 2011 09:50:59 GMT
Hi All,

I want to create index between two tables, stock and auction. Basically I am
working on a product site. So I have to create index on both tables. and
they are not related at all.

In data-config.xml, that I created to create index, I wrote the following
code

<dataConfig>
    <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lc" user="root" password=""/>
    <document name="content">
        <entity name="stock" query="select
ST_StockID,ST_StockCode,ST_Name,ST_ItemDetail from stock where estatus =
'Active' limit 100">
            <field column="ST_StockID" name="stock_ST_StockID" />
            <field column="ST_StockCode" name="stock_ST_StockCode" />
            <field column="ST_Name" name="stock_ST_Name" />
            <field column="ST_ItemDetail" name="stock_ST_ItemDetail" />

        </entity>
        <entity name="auction" query="select
iauctionid,rad_number,vsku,auction_code from auction limit 100">
            <field column="iauctionid" name="auction_iauctionid" />
            <field column="rad_number" name="auction_rad_number" />
            <field column="vsku" name="auction_vsku" />
            <field column="auction_code" name="auction_auction_code" />
        </entity>
    </document>
  </dataConfig>


and the schema.xml contains the fields are given below.

<fields>
<field name="stock_ST_StockID" type="string" indexed="true" stored="true"
required="true"/>
    <field name="stock_ST_StockCode" type="string" indexed="true"
stored="true" required="true"/>
    <field name="stock_ST_Name" type="string" indexed="true" stored="true"
required="true"/>
    <field name="stock_ST_ItemDetail" type="text" indexed="true"
stored="true" required="true"/>

    <field name="auction_iauctionid" type="string" indexed="true"
stored="true" required="true"/>
    <field name="auction_rad_number" type="string" indexed="true"
stored="true" required="true"/>
    <field name="auction_vsku" type="string" indexed="true" stored="true"
required="true"/>
    <field name="auction_auction_code" type="text" indexed="true"
stored="true" required="true"/>
<fields>
 <uniqueKey>stock_ST_StockID</uniqueKey>

<defaultSearchField>stock_ST_ItemDetail</defaultSearchField>

And when I hit this url :
http://192.168.1.48:8983/solr/dataimport?command=full-import

I get the below xml is response.

<response>
−
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
</lst>
−
<lst name="initArgs">
−
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
−
<lst name="statusMessages">
<str name="Total Requests made to DataSource">2</str>
<str name="Total Rows Fetched">200</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2011-11-18 15:14:55</str>
−
<str name="">
Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.
</str>
<str name="Committed">2011-11-18 15:14:55</str>
<str name="Optimized">2011-11-18 15:14:55</str>
<str name="Total Documents Processed">0</str>
<str name="Time taken ">0:0:0.47</str>
</lst>
−
<str name="WARNING">
This response format is experimental.  It is likely to change in the future.
</str>
</response>

Any help will be appreciated .

Thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/Create-index-on-two-unrelated-table-in-Solr-tp3518202p3518202.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message