I forgot one little detail.
The DB server is untouchable. I have "read-only" access to it. The database is a component of an big "enterprisy" CMS. The obvious solution of adding a "#Posts" field to the table updated with a trigger is not viable.
We have a ticket open with the vendor, but they are not what we could call 
agile.

--
Luis Neves


Luis Neves wrote:
Hello all,

We have a Solr/Lucene index for newspaper articles, those articles have associated comments. When searching for articles we want to present the number of comments per article. What we do now is to fetch from the DB the sum of comments for each articleId that Solr returns, but this is bringing the DB to its knees. We would like to store the number of comments in the Solr index to save the DB some work.

Is it possible when updating a numeric field to increment the existing value instead of replacing it with a new value?

The problem we are having is that we can't retrieve the number of comments increment it and update the index because the "actual" value might be uncommitted... is there any other alternative to this problem?

Thanks in advance for any help.

--
Luis Neves


Reply via email to