Solr 1.4实例索引有数据但*:*搜索无结果排查求助
Hey there, let's troubleshoot why your Solr 1.4 instance isn't returning results for *:* even though the index files exist in data/index/. I’ve dealt with similar oddities in older Solr versions, so here are the most likely fixes to check step by step:
Solr 1.4 can sometimes fail to initialize a core properly even if the dataDir is set correctly. Head over to the Core Admin section in the Solr web UI and confirm your target core shows a "loaded" status. If it’s not loaded:
- Double-check the core definition in
solr.xmlto ensure thenameandinstanceDirmatch your setup. - Try manually clicking the "Load Core" button in Core Admin to trigger initialization.
Even if the index files exist, the Tomcat 6.0 user (usually tomcat6) might not have read access to them. Run these commands to diagnose and fix this:
- List permissions:
ls -l /path/to/your/solrhome/data/index - Adjust ownership if needed:
sudo chown -R tomcat6:tomcat6 /path/to/your/solrhome/data - Set read/execute permissions:
sudo chmod -R 755 /path/to/your/solrhome/data
Solr 1.4 relies on Lucene 2.9.x under the hood. If your index was created with a newer Lucene/Solr version, Solr 1.4 won’t be able to read it. To fix this:
- Re-import your data using a Solr 1.4-compatible client (like the built-in DataImportHandler or a Lucene 2.9.x-based tool).
- Avoid using indexes generated by Solr 3.x+ with this instance.
It’s easy to overlook: check the Core Selector dropdown at the top of the Solr query UI. If you’re querying a default empty core instead of the one with your index, *:* will naturally return nothing. Switch to the correct core and re-run the query.
Take a look at your solrconfig.xml to ensure there aren’t unintended default filters that are hiding all results. For example:
- Look for a
<defaultQuery>element that overrides*:*with something restrictive. - Check
<searchComponent>or<requestHandler>definitions for hardcodedfq(filter query) parameters that might exclude all documents.
If Solr crashed or was shut down improperly, a write.lock file might be lingering in the data/index/ directory, preventing Solr from accessing the index. Here’s how to fix it:
- Stop Tomcat 6.0 completely.
- Delete the
write.lockfile from/path/to/your/solrhome/data/index/. - Restart Tomcat and re-run the
*:*query.
内容的提问来源于stack exchange,提问作者TimAlonso

