使用SolrJ将对象索引到
Solr
中,设置了主键为tvId
可是在往Solr
中添加时,同一个tvId
的对象会被重复索引,导致搜索时,会搜出来多个同样的对象;我的
schema.xml
配置如下 :
<field name="tvId" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
<uniqueKey>tvId</uniqueKey>
- 列表项目
还望大神们知道下,如果同一个
tvId
的对象不会重复索引到Solr
中
solr5.5
在配置需要索引的字段时,需要添加配置信息到managed-schema
文件中,之前我是配置在schema.xml
文件中,所以没有生效;managed-schema
文件中配置,具体路径为`/home/pekxxoo/solr/solr-5.5.0/server/solr/core_name/conf`