简体   繁体   English

从SQL在Solr中导入数据

[英]Data Import in Solr from SQL

I am working on indexing data from MySql into Solr . 我正在将数据从MySql索引到Solr中。 Following is the response XML I received after this command : localhost:8080/solr/dataimport?command=full-import&flush=true 以下是在此命令后收到的响应XML:localhost:8080 / solr / dataimport?command = full-import&flush = true

<response>
 <lst name="responseHeader">
   <int name="status">0</int>
     <int name="QTime">5</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">1</str>
             <str name="Total Rows Fetched">2599</str>
           <str name="Total Documents Skipped">0</str>
          <str name="Full Dump Started">2012-12-04 11:51:45</str>
             <str name="">Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.</str>
               <str name="Committed">2012-12-04 11:51:46</str><str name="Total Documents Processed">0</str>
           <str name="Time taken">0:0:1.112</str></lst
           ><str name="WARNING">This response format is experimental.  It is likely to change in the future.</str></response>

The index is supposed to be in the index directory under data directory right ? 索引应该位于数据目录下的索引目录中吗? I tried viewing it through Luke GUI , it did not show anything , am I even able to create the index correctly here ? 我尝试通过Luke GUI进行查看,但没有显示任何内容,我什至可以在这里正确创建索引吗? (My Sql query returns just one column and the field types have been defined in schema.xml) (我的SQL查询仅返回一列,并且已在schema.xml中定义了字段类型)

This is my data-config.xml : 这是我的data-config.xml:

<dataConfig>
   <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"           url="jdbc:mysql://localhost/mydb" user="root" password="123"/>
    <document>
        <entity name="procname" query="Select ap.procname from cur_aprocedures ap 
                               left join test_data ts on ts.procid = ap.procid">
        <field column="procname" name="procname" />

</entity>       

Use the full import option with commit enabled. 在启用提交的情况下使用完全导入选项。 This would commit the data into the solr index and would be available for searching. 这会将数据提交到solr索引中,并且可用于搜索。
If you are doing DIH from the web UI screen, usually you would have a Commit checkbox which needs to be selected for Solr to commit the changes after the end of ther DIH cycle. 如果要从Web UI屏幕执行DIH,通常将需要选中一个Commit复选框,以便Solr在DIH周期结束后提交更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM