你知道如何设置solr不存在_“ str”吗?

时间:2019-01-09 08:26:24

标签: solr

我用Apache Solr来索引数据库,问题是创建名为“ * _str”的字段。有人告诉update.autoCreateFields:true更改为false。但它仍然有效!请帮助我和我的记忆:(

例如,在Java中,我使用了SolrInputDocument.addField(“ A”,valueOfA),SolrInputDocument.addField(“ B”,valueOfB)。 然后,Solr在场 “ A”:“ vauleofA” “ B”:“ vauleofB” “ A_str”:“ vauleofA” “ B_str”:“ vauleofB”

1 个答案:

答案 0 :(得分:1)

在标准的Solr 7安装中,当Solr自动添加字段时(例如,当update.autoCreateFields设置为true时),您将获得默认情况下也添加的这些_str字段。例如,如果您将以下文档添加到Solr:

[
  { "id": "test01", "somefield": "hello world" }
]

您将在模式somefieldsomefield_str中看到两个字段。我相信附加_str字段的配置是在solrconfig.xml下的AddSchemaFieldsUpdateProcessorFactory文件中定义的(查找autoCreateFields)-但我对此不确定。

如果在导入创建了这些字段的文档后将false设置为 log_dbg_printf("Received privsep req type %02x sz %zd on srvsock %i\n", req[0], n, srvsock); ,则这些字段将保留在您的模式中(以及已经包含在这些文档中的文档它们。)您将需要重新创建架构以摆脱它们。