我通过Dataimporthandler从MySql导入数据.这非常有效,我收到此消息:
索引已完成.添加/更新:2,172个文档.删除了0个文件.(时长:01秒)请求数:1(1/s),提取:2,172(2,172/s),跳过:0,已处理:2,172(2,172/s)
但是,当我查看我的概述时,它说:
Num Docs:1470 Max Doc:2172删除文档:702
所以702个文件被删除了,原因我无法弄明白.在我的架构中,我不使用任何唯一的字段或可能会给重复项带来麻烦的东西.
数据-config.xml中
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="xxx"
user="xxx"
password="xxx"
/>
<document>
<entity name="product" query="CALL getSolrProducts();" transformer="RegexTransformer">
<field column="uuid" name="uuid"/>
<field column="id" name="id"/>
<field column="productimage" name="productimage"/>
<field column="producturl" name="producturl"/>
<field column="productpricenew" name="productpricenew"/>
<field column="productpriceold" name="productpriceold"/>
<field column="brandid" name="productbrand"/>
<field column="productbrandname" name="productbrandname"/>
<field column="productbrandurl" name="productbrandurl"/>
<field column="productbrandimage" name="productbrandimage"/>
<field column="productbranddata" name="productbranddata"/>
<field column="productshippingcoast" name="productshippingcoast"/>
<field column="productlink" name="productlink"/>
<field column="color" name="color" splitBy=","/>
<field column="colordata" name="colordata" splitBy=","/>
<field column="productdescription" name="productdescription"/>
<field column="upc" name="upc" splitBy=","/>
<field column="productname" name="productname"/>
<field column="productshop" name="productshop"/>
<field column="productshopname" name="productshopname"/>
<field column="productshopimage" name="productshopimage"/>
<field column="productimagethumb" name="productimagethumb"/>
<field column="productshopdata" name="productshopdata"/>
<field column="cat1id" name="cat1id"/>
<field column="cat2id" name="cat2id"/>
<field column="cat3id" name="cat3id"/>
<field column="cat4id" name="cat4id"/>
<field column="cat1data" name="cat1data"/>
<field column="cat2data" name="cat2data"/>
<field column="cat3data" name="cat3data"/>
<field column="cat4data" name="cat4data"/>
<field column="size" name="size" splitBy=","/>
<field column="sizedata" name="sizedata" splitBy=","/>
<field column="recommendations" name="recommendations" splitBy=","/>
</entity>
</document>
</dataConfig>
Run Code Online (Sandbox Code Playgroud)
指针?
自您检查后clean,DIH首先发出"全部删除"更新查询,然后开始发布新文档.索引完成后,DIH会发出一个提交,它只会保留已发布的新文档并删除索引开始之前存在的所有旧文档.您的数据库必须已更新,因此您现在获得了更多文档,702个已删除的文档对应于索引开始之前索引中存在的文档.(检查optimizeDIH将清除已删除的文档,但对于大型索引进行优化可能会很昂贵,并且删除的文档无论如何都不会显示在搜索结果中,因此可能没什么好处.)
| 归档时间: |
|
| 查看次数: |
1288 次 |
| 最近记录: |