0

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.

4

1 回答 1

0

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.

于 2019-08-13T23:56:48.780 回答