You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jérôme Etévé <je...@gmail.com> on 2008/12/16 19:16:21 UTC

Accessing multiple core via cross context queries.

Hi All,

 I'm developping a webapp that needs access to the solr webapp.

 I can get my solr context like that:

 ServletContext solrContext = getServletContext().getContext("/solr");

 but when I do

 solrContext.getRequestDispatcher("/core0/select/").dispatch(request,response)
;

 I get a 404 error:

  HTTP Status 404 - /solr/core0/select/

type Status report

message /solr/core0/select/

description The requested resource (/solr/core0/select/) is not available.


Beside that, if access /solr/core0/select/ directly then everything is fine.

>From what I saw in the sources , solr relies on a Filter notion to
deal with queries involving multicore, but I cannot see why this could
have an influence on what resources is available from the eyes of who.

Can't a webapp see the same things as the web users does ? j2ee gurus help !

Is there something I'm missing here ? (both webapps are with crossContext=true )


Cheers!

Jerome.


-- 
Jerome Eteve.

Chat with me live at http://www.eteve.net

jerome@eteve.net

Re: Accessing multiple core via cross context queries.

Posted by Chris Hostetter <ho...@fucit.org>.
: >From what I saw in the sources , solr relies on a Filter notion to
: deal with queries involving multicore, but I cannot see why this could
: have an influence on what resources is available from the eyes of who.
: 
: Can't a webapp see the same things as the web users does ? j2ee gurus help !
: 
: Is there something I'm missing here ? (both webapps are with crossContext=true )

i think you already noticed in another thread that this is probably 
because Solr doens't use the <dispatcher>FORWARD</dispatcher> option in 
web.xml ... as mentioned in that thread, you could try turning it on, but 
my advice owuld be to just use SolrJ to connect to the solr webapp 
over the network exactly as if it were on a remote host 
(ie: "http://localhost:XXXX/solr").  now you have a much cleaner 
abstraction between your code and solr, and if you decide later that you 
want to scale out by moving solr to it's own box you don't have to rewrite 
any code.

if you relly want a tight binidng to solr, just embed the whole solr.war 
inside of your own war (the RequestDispatcher has a "prefix" option to 
make this easy)



-Hoss