You can give a default core set by adding a default parameter to the query
in solrconfig.xml. This is hacky, but it gives you a set of cores instead of
just one core.

-----Original Message-----
From: David Smiley @MITRE.org [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 08, 2008 7:54 AM
To: solr-user@lucene.apache.org
Subject: Re: AW: Cross-context-forward to solr-instance


FWIW, I'm also using the SolrRequestFilter for forwards, despite the
warning. 
Solr1.3 doesn't have the concept of a default core anymore yet I want this
feature.  I made an uber-simple JSP like this:
<jsp:forward page="<%= "mycorename/select?" + request.getQueryString() %>"
/>
And so now my clients don't need to update their URL just because I've
migrated to Solr 1.3.  Oh, I needed to set up the dispatcher FORWARD as you
mentioned and I also remapped the /select/* servlet mapping to my jsp.:
  <servlet>
    <servlet-name>selectDefaultCore</servlet-name>
    <jsp-file>/selectDefaultCore.jsp</jsp-file>
  </servlet>

  <servlet-mapping>
    <servlet-name>selectDefaultCore</servlet-name>
    <url-pattern>/select/*</url-pattern>
  </servlet-mapping>

The only problem I've seen so far is that if I echo the params
(echoParams=all), I see the output doubled.  Weird but inconsequential.

~ David Smiley


Hachmann wrote:
> 
> Hi,
> 
> I made a mistake. At least with Tomcat 5.5.x, if you configure the 
> SolrRequestFilter with <dispatcher>FORWARD</dispatcher> it indeed gets 
> called even when you forward from another web-context!
> 
> Note, that the documentation says this might be problematic!
> 
> Sorry for the previous overhasty post.
> Björn
> 
>> -----Ursprüngliche Nachricht-----
>> Von: 
>> [EMAIL PROTECTED]
>> g
>> [mailto:[EMAIL PROTECTED]
> pache.org] Im Auftrag von Hachmann, Bjoern
>> Gesendet: Samstag, 6. September 2008 08:01
>> An: solr-user@lucene.apache.org
>> Betreff: Cross-context-forward to solr-instance
>> 
>> Hi,
>>  
>> yesterday I tried the Solr-1.3-RC2 and everything seems to work fine 
>> using the traditional single-core setup. But while troubleshooting 
>> the new multi-core feature, I realized for the first time, that I 
>> have been using the deprecated (even in 1.2) class SolrServlet. This 
>> is a huge problem for us, as we run the solr-web-app parallel to our 
>> main web-app in the same servlet-container. Using this approach we 
>> can internally forward update- and select-requests to the 
>> Solr-instance currently in use.
>>  
>> ServletContext ctx = getServletContext().getContext("solr1");
>> RequestDispatcher rd = ctx.getNamedDispatcher("SolrServer");
>> rd.forward(request, response);
>> 
>> As you can see, this approach only works for the servlet named 
>> 'SolrServer' which references the deprecated class.
>> 
>> The attempt of using a path based dispatcher
>> (ctx.getRequestDispatcher) was not successful, even though I 
>> configured the SolrRequestFilter in the solr-web.xml to work on 
>> forwards (<dispatcher>FORWARD</dispatcher>), which the documentation 
>> discourages. Maybe this is because of the cross-context-dispatch?
>> 
>> At the moment I ran totally out of ideas, apart from completely 
>> redesigning our whole setup. Any ideas are highly appreciated.
>> 
>> Thanks in advance,
>> Björn
> 
> 

--
View this message in context:
http://www.nabble.com/Cross-context-forward-to-solr-instance-tp19343349p1937
3757.html
Sent from the Solr - User mailing list archive at Nabble.com.


Reply via email to