On 8/25/23 10:44, Shawn Heisey wrote:
On 8/25/23 10:21, Christopher Schultz wrote:
I believe we have only used Solr 7 and above. Is there a way to confirm without actually /trying/ it?

There is this very cool endpoint shared by Rahul that I did not know about:

I can confirm that running this shell script will completely clear out the versions:

DEL_ALL_QUERY_XML="<delete><query>*:*</query></delete>"
SOLR_URL_BASE="${SOLR_SCHEME}://${SOLR_HOST}:${SOLR_PORT}/solr"
DOVECOT_SOLR_UPDATE_URL="${SOLR_URL_BASE}/${INDEX_NAME}"

  curl -m 2 -f -s \
    "${DOVECOT_SOLR_UPDATE_URL}/update?commit=true&optimize=true&wt=json" \
      -H "Content-Type: text/xml" \
      --data-binary "${DEL_ALL_QUERY_XML}"

This runs very quickly. I include optimize=true just to make sure that old segments are actually deleted. It's probably not required ... I'm just being cautious.

I would still recommend a reload or restart after doing that. Reload is faster and less disruptive than restart.

The main reason that I recommend deleting index* directories and reloading the index on reindex is to ensure certain schema changes will work without issue. In this case, I don't think you're changing the schema.

Thanks,
Shawn

Reply via email to