solr原子更新-即指定更新某个字段的值
2016-03-29 21:54
295 查看
官方文档:https://wiki.apache.org/solr/Atomic_Updates
SolrInputDocument solrInputDocument = new SolrInputDocument();
solrInputDocument.addField("id", id);
Map<String, String > operation = new HashMap<>();
operation.put("set", "test1");
solrInputDocument.addField("title", operation);
solrServer.add(solrInputDocument);
solrServer.commit();
官方文档中,要注意:
The core functionality of atomically updating a document requires that all fields in your SchemaXml must be configured as stored="true"
solr原子更新,支持store=true,如果store为false,更新后字段会丢失。
SolrInputDocument solrInputDocument = new SolrInputDocument();
solrInputDocument.addField("id", id);
Map<String, String > operation = new HashMap<>();
operation.put("set", "test1");
solrInputDocument.addField("title", operation);
solrServer.add(solrInputDocument);
solrServer.commit();
官方文档中,要注意:
The core functionality of atomically updating a document requires that all fields in your SchemaXml must be configured as stored="true"
solr原子更新,支持store=true,如果store为false,更新后字段会丢失。
相关文章推荐
- 在Eclipse中运行Solr 基础知识
- Solr 5.3.0集成mmseg4j、tomcat部署、Solrj 5.3.0使用
- Solr基础--设置solr/home的三种方式
- windows下安装solr5.5.0
- Docker使用supervisor构建solr
- solr4.0安装和简单导入mysql数据
- Solr 4.0 基础教程
- 自译Solr in action中文版
- Solr In Action 中文版 第一章(一)
- Solr In Action 中文版 第一章 (二)
- Solr In Action 中文版 第一章(三)
- 基于solr实现hbase的二级索引
- 基于Nutch&Solr定向采集解析和索引搜索的整合技术指南文档
- 基于Nutch&Solr定向采集解析和索引搜索的整合技术指南文档
- Tomcat/Solr4.3.1 配置过程
- Solr Facet技术的应用与研究
- Apache Solr查询语法
- Solr客户端删除数据的方式
- Solr5.4 在 Tomcat 部署
- Centos 安装 Solr