mysql索引和solr区别_java – 使用solr索引和搜索MySQL

(我已经在下面的XML中显示了它)

大家好我想用solr索引我的MySQL数据库表.我已经安装了必要的java组件/适配器等.我的数据库名为’test_db’,其中的表名为’table_tb’.该表包含2列(字段)

-Field 1称为“ID”,是一个自动增量的主键整数

-Field 2被称为’COLA’并且是文本

该表有两行(记录)ID = 1和ID = 2,其中一些文本对应于第二列.我已经设置了以下conf文件(它们位于正确的目录中):

数据-config.xml中

driver="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost/test_db"

user="username"

password="db_pwd"/>

solrconfig.xml中

data-config.xml

schema.xml中

ID

“[URL]:8983 / solr / dataimport?command = full-import”在我的浏览器中,我得到以下输出:

(1)浏览器输出(xml)

0

1

data-config.xml

full-import

idle

1

2

0

2010-08-03 16:15:51

Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.

2010-08-03 16:15:51

2010-08-03 16:15:51

0

2

0:0:0.32

This response format is experimental. It is likely to change in the future.

建议读取2条记录但未编入索引

服务器端输出

WARNING: Error creating document : SolrInputDocument[{ID=ID(1.0)={1}}]

org.apache.solr.common.SolrException: Document [null] missing required field: id

WARNING: Error creating document : SolrInputDocument[{ID=ID(1.0)={2}}]

org.apache.solr.common.SolrException: Document [null] missing required field: id

有谁知道我做错了什么?

在此先感谢任何帮助!

解决方法:

字段“id”出现在文档的其他位置.我评论了这一点并且有效.

标签:java,mysql,search,solr,lucene

来源: https://codeday.me/bug/20190621/1257779.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值