node.js - Updates not visible to client after Solr softCommit
问题描述
I have a node application which queries and updates a solr instance. Queries all work fine. When I edit an item and submit the update, however, it doesn't show up when I query again, unless I restart the solr server.
I am currenlty running solr 6.1.0 and using solr-node-client http://lbdremy.github.io/solr-node-client/
I am using autoSoftCommit configured in solarconfix.xml.
<updateLog>
<str name="dir">${solr.ulog.dir:}</str>
<int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
</updateLog>
<autoCommit>
<maxDocs>10</maxDocs>
<maxTime>300000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<autoSoftCommit>
<maxTime>500</maxTime>
</autoSoftCommit>
I have also tried setting commit/softCommit and commitWithin as part of the update request in the client with no luck.
When I look at the Solr log, I can see the softCommit and hard commits going on the specified cadence, and I can see the changes in the transaction log as well, but they do not become visible to the client until a server restart.
解决方案
Found my own issue. The autoCommit configuration was correct, as evidenced by the logs. The issue was by default the <enableLazyFieldLoading>
parameter in the <query></query>
block was set to true
, so it was not fetching the latest values of the fields. Setting <enableLazyFieldLoading>
to false
forces the application to re-read the value of the field.
推荐阅读
- php - Laravel 7 中的路由哈希
- javascript - 我有 Reactjs 和 Typescript 的问题类型。我设置类型 dataResponse 。我觉得重叠!如何短代码?
- windows - Windows powershell AWSCLI 退出并提示“您要如何打开此文件”
- python - 将串行数据从 Arduino 写入 Raspberry Pi 上的文本文件时出现问题
- django - 新用户无法创建帐户,登录和注册 url 被重定向到同一页面 Django
- azure - 如何为 Azure B2C 中的 SignUp_SignIn 自定义策略自定义创建帐户页面?
- python - 如何获取实时 Python 子进程输出?
- swift - 本地化 iOS 14 动态小部件配置
- javascript - 如何使用带有条件的 React Routes 和 Redux?
- r - R中带有串扰和传单的响应式热图