I'm running solr on dotcloud for my django app (using haystack) and am running into some trouble. I receive a 404 "missing core name in path" message when trying to access the admin, despite the fact that--as far as I can tell--I only have a single core.
Here is my schema.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
<!--
adminPath: RequestHandler path to manage cores.
If 'null' (or absent), cores will not be manageable via request handler
-->
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." shard="shard1"/>
</cores>
</solr>
When I point my browser at .../solr/collection1/admin, still nothing. But since I've only got a single core shouldn't I just be able to go to .../solr/admin?
I've followed the steps on the haystack "getting started tutorial" as well as the dotcloud solr service docs.
The relevant code in my settings.py:
HAYSTACK_SITECONF = 'gigmash.search_sites'
HAYSTACK_SEARCH_ENGINE = 'solr'
HAYSTACK_SOLR_URL = 'http://35543365.dotcloud.com/solr' #provided by dotcloud
HAYSTACK_INCLUDE_SPELLING = True
HAYSTACK_SEARCH_RESULTS_PER_PAGE = 10
And here's the error I get when I try and test in the interpreter:
>>> from haystack.query import SearchQuerySet
>>> sqs = SearchQuerySet().all()
>>> sqs.count()
Failed to query Solr using '*:*': [Reason: None]
java.lang.NullPointerException at org.apache.solr.servlet.SolrServlet.doGet(SolrServlet.java:91) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:297) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.Queue开发者_如何学编程dThreadPool$PoolThread.run(QueuedThreadPool.java:582)
I find it especially amusing that my error output says "reason: none" :-P
Perhaps also relevant: despite having run ./manage.py build_solr_schema and ./manage.py rebuild_index (and having rebuild index (accurately) report the number of models indexed), a data/ directory has not been created in my solr/ directory.
Any help would be greatly appreciated. Total newb with solr/haystack/dotcloud/everything!
Solved.
It ended up being an issue with my dotcloud.yml file.
精彩评论