【发布时间】:2015-05-14 05:48:29
【问题描述】:
我正在使用 Apache solr-5.1.0 搜索 pdf 文档 我使用 bin/post 方法对所有文档进行了索引。
我添加了一个像 curl 这样的自定义字段
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"ZoneId",
"type":"strings",
"indexed" : true,
"docValues":true,
"stored":true }
}' http://localhost:8983/solr/taxsutra/schema
现在当我调用搜索查询时,这个 ZoneId 没有显示在 json 结果中。
更新索引的代码:
curl http://localhost:8983/solr/taxsutra/update/json -H 'Content-type:application/json' -d '
[
{"id" : "home/niyuj/projects/php/solr-5.1.0/../itat_src/Upload/KOLKATA/Kolkata/24-11-2014/307176844630250930713$5^1REFNOITA_No._1873.2012.pdf", "ZoneId" : "4"},
{"id" : "/home/niyuj/projects/php/solr-5.1.0/../itat_src/Upload/KOLKATA/Kolkata/24-11-2014/-421302573392022465313$5^1REFNOITA-473-Kol-2014-Mathan-24_11.pdf", "ZoneId" : "5"}
]'
【问题讨论】:
-
我可以在架构文件中看到 zoneid 字段