Troubleshooting search error -37
When you use the advanced search feature in HTML files exported from Dr.Explain, you may encounter error messages with code -37 instead of search results.
Error -37 means the search tab cannot load the search index files. This usually happens when the web server is not configured correctly or the files are missing on the server.
Common causes
-
Missing files: the de_search folder was not uploaded. Re-export and upload all files.
-
Wrong permissions: files cannot be read by the web server. Fix file permissions on the server.
-
Server configuration: the web server is not configured to serve JavaScript files. Update your server configuration.
-
Network issues: a firewall is blocking access. Check your network and firewall settings.
-
Open your documentation in a web browser.
-
Click on any topic in the menu.
-
In the browser's address bar, change the URL by removing the filename at the end and adding /de_search/descriptor_id.js, for example:Change from: http://your-server.com/docs/some-file.htmChange to: http://your-server.com/docs/de_search/descriptor_id.js
-
Press Enter.
What you should see: a page showing JavaScript code that starts with this text:
DR_EXPLAIN = DR_EXPLAIN || {};
If you see a 404 error instead: the file is missing or the web server cannot find it. Go to Step 3 to verify the files are on the server.
If you see the JavaScript code: the file exists, but there might be another issue. Go to Step 2 to check for errors.
-
Press F12 or Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac) to open the browser's developer tools. Alternatively, use the browser's menu (search for "Web developer tools" or similar menu entries).
-
Click the Console tab.
-
Refresh the page.
-
On the page, go to the Search tab, enter text in the search box, and click the Search button.
-
Look for error messages in red in the console.
Common errors you might see:
-
404 errors: the file cannot be found. Go to Step 3.
-
CORS errors: the web server is blocking cross-origin requests. This requires server configuration changes. Contact your server administrator.
-
MIME type errors: the file is being served with the wrong type. Go to Step 4.
This step requires access to your server via SSH or similar terminal connection.
-
Connect to your server using SSH.
-
Run this command (adjust the path if your files are in a different location):
ls -la /var/www/html/de_search/descriptor*.js
What you should see: files named descriptor_id.js and descriptor.js with permissions like -rwxr-xr-x. The r among the last three characters of the permissions text means the files are readable.
If you don't see these files: the files were not uploaded correctly. Re-export your Dr.Explain project to HTML and upload all files and folders to your web server. Then go back to Step 1 and test again.
If you see the files but they don't have r in the permissions: the web server cannot read them. Contact your server administrator to fix the file permissions.
This step requires access to your server's configuration files.
For nginx servers:
Check that your nginx configuration includes this section:
location ~ \.js$ {
default_type application/javascript;
add_header Access-Control-Allow-Origin *;
}
For Apache servers:
Check that your Apache configuration allows JavaScript files to be served correctly.
If the configuration is missing or incorrect: add the appropriate configuration and restart your web server. Then go back to Step 1 and test again.