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.

nmogk
  • 73
  • 5
  • How are you committing? Your config file show that you have `false` - which means that the newly committed index will not be opened and used before something else causes the searcher to be reopened - for example the server is restarted or the core being reloaded. If you don't open a new searcher, the old index will still be served. – MatsLindh Aug 10 '19 at 10:49
  • I am also using an autoSoftCommit, which I thought would make the changes visible immediately. In the log when the softCommit is executed the parameters show openSearcher=true – nmogk Aug 11 '19 at 16:03
  • Could it perhaps be related to the queryResultCache or other caching mechanism? My default solarconfig.xml has `` – nmogk Aug 13 '19 at 23:25

1 Answers1

1

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.

nmogk
  • 73
  • 5