API - Re-queue Crawled URLs for Re-crawling

Web Crawler
Web Crawler API

Re-queue Crawled URLs for Re-crawling

Takes all URLs the crawler has already processed (the done queue) and puts them back into the todo queue. The next start_crawl re-fetches every known page — content updates land in the index while the existing documents keep serving searches. The “Reindex” buttons of the Drupal module and WordPress plugin use it.

Endpoint

GET or POST https://opensolr.com/solr_manager/api/move_done_to_todo

Parameters

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key (master key, or a scoped key that allows this endpoint)
core_nameRequiredThe index whose crawler queues are reset

How It Works

The crawler on the Solr server keeps two lists per index: URLs still to fetch and URLs already fetched. This call moves the second list into the first and reports how many entries moved. Nothing is deleted from Solr, so there is no gap in search results; each page is simply re-fetched and re-indexed in place (same document id = same URL) when the crawler runs again. Combine with start_crawl (and clean=no) for a refresh, or with reset_index + clean=yes for a full rebuild.

Response

KeyTypeDescription
statusbooltrue when processed
msgstringHuman-readable summary
movedintNumber of URLs re-queued

Code Examples

$_ cURL

curl -s "https://opensolr.com/solr_manager/api/move_done_to_todo?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index"
# then
curl -s "https://opensolr.com/solr_manager/api/start_crawl?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&clean=no&schedule=no"

PHP PHP

$q = http_build_query(['email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'core_name' => 'my_index']);
$r = json_decode(file_get_contents("https://opensolr.com/solr_manager/api/move_done_to_todo?{$q}"), true);
echo $r['moved'], " URLs re-queued\n";

Py Python

import requests

auth = {"email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "core_name": "my_index"}
print(requests.get("https://opensolr.com/solr_manager/api/move_done_to_todo", params=auth, timeout=30).json())
requests.get("https://opensolr.com/solr_manager/api/start_crawl", params={**auth, "clean": "no", "schedule": "no"}, timeout=30)

Example Response

{"status": true, "msg": "Re-queued 4 URLs for re-crawling.", "moved": 4}

Use Cases

  • Refresh all indexed pages after a site-wide content or template change
  • Re-crawl after fixing a robots.txt or scope rule that had skipped pages
  • Implement a “Reindex everything” button without downtime

Related Documentation

Need help with the Opensolr API? We are here to help.

Contact Support