Solr 部分 局部字段修改 更新 删除
2015-11-26 17:19
495 查看
Solr支持简单的原子更新(也被称为部分更新)单文件通过字段修饰符如ADD,Inc.乐观并发控制是自动更新文件的一种方法。
Solr支持整个doc 更新几个字段,自动更新文档中的值。
set – set or replace a particular value, or remove the value if null is specified as the new valueadd – adds an additional value to a list
remove – removes a value (or a list of values) from a list
removeregex – removes from a list that match the given Java regular expression
inc – increments a numeric value by a specific amount (use a negative value to decrement)
Solr支持整个doc 更新几个字段,自动更新文档中的值。
set – set or replace a particular value, or remove the value if null is specified as the new valueadd – adds an additional value to a list
remove – removes a value (or a list of values) from a list
removeregex – removes from a list that match the given Java regular expression
inc – increments a numeric value by a specific amount (use a negative value to decrement)
// create the SolrJ client HttpSolrClient client = newHttpSolrClient("http://localhost:8983/solr"); // create the document SolrInputDocument sdoc = newSolrInputDocument(); sdoc.addField("id","book1"); Map<String,Object> fieldModifier = newHashMap<>(1); fieldModifier.put("add","Cyberpunk"); sdoc.addField("cat", fieldModifier); // add the map as the field value client.add( sdoc ); // send it to the solr server client.close(); // shutdown client before we exit
相关文章推荐
- 2015年11月26日17:18:59
- sed 正则表达式【MAC地址】GLPI转换华为交换机MAC格式
- WinDbg 调试dmp文件
- LintCode_字符串查找
- Android调用相机保存图片到相册
- AlertDialog应用——App退出提示框
- 漫谈人机界面测试
- javac 错误: 编码GBK的不可映射字符
- 授权后接口调用(UnionID)
- C++ this pointer
- 玩玩三维重建
- 机器学习中的数学(5)-强大的矩阵奇异值分解(SVD)及其应用
- Redis五种数据类型
- Flume1.5.0入门:安装、部署、及flume的案例
- GitExt 如何应用到VS2013中
- Beginning Python Chapter2
- JavaScript中使用sencha gridpanel 编辑单元格、改变单元格颜色
- java new date 与系统时间相差8小时
- iOS 使用tableView实现 个人中心列表
- 96 Note the following parameters settings in your database: SGA_MAX_SIZE = 1024M SGA_TARGET = 700M D