Change Solr search directory to my custom named index directory
In the /data directory of solr, suppose, I have three folders named as index, custom, spellCheck. So, the problem is when I open up localhost:8983/solr/admin and try to search, solr makes a search only in the index folder. I want solr to search in the 'custom' folder inside the /data folder. Can it be done?
If I see the 'schema browser', and go through the schema information, there is a 'directory' property such as, directory: 开发者_JAVA技巧 org.apache.lucene.store.NIOFSDirectory:org.apache.lucene.store.NIOFSDirectory@ /home/mypc/softwares/apache-solr-3.4.0/example/solr/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@6c5482
I think that /solr/data/index directory should point to /solr/data/custom, for the search to work.
You can also use the index.properties file to point to which directory Solr loads. It goes in the data directory and it has a index property pointing to the directory name to be used instead of 'index'
That's worked for me without issue. I believe this was done to help make replication work seamlessly.
Solr uses index directory as the fixed name, so i don't think it can be customized unless you modified the code.
solr.core.dataDir -- The core's data directory (i.e. the directory under which that core's index directory are located)
If you need the search to work only on the custom directoy, you can try creating a symlink.
精彩评论