Multicore - Querying unloaded core returns results from default

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multicore - Querying unloaded core returns results from default

Andy Olliver-2
Hi

When using multiple cores I can query loaded cores using:
http://localhost:8080/solr-HEAD/[CORE_NAME]/select?....
and all works nicely.

I can also query non-loaded cores and get a response from the default core.
http://localhost:8080/solr-HEAD/[NON_EXISTENT_CORE]/select?....
Would it be best for this result in an error response?

Andy

Reply | Threaded
Open this post in threaded view
|

Re: Multicore - Querying unloaded core returns results from default

Andy Olliver-2
This code in SolrDispatchFilter seems to pick first known core in cases
where core name is not recognised.
##
     if( core == null ) {
          Collection<SolrCore> cores = multicore.getCores();
          if( cores != null && cores.size() > 0 ) {
            core = cores.iterator().next();
          }
          if( core == null ) {
            throw new RuntimeException( "MultiCore request can not find a
valid core" );
          }
        }
##
the Runtime exception is only thrown if no cores are defined at all.

Andy

> Hi
>
> When using multiple cores I can query loaded cores using:
> http://localhost:8080/solr-HEAD/[CORE_NAME]/select?....
> and all works nicely.
>
> I can also query non-loaded cores and get a response from the default
> core.
> http://localhost:8080/solr-HEAD/[NON_EXISTENT_CORE]/select?....
> Would it be best for this result in an error response?
>
> Andy
>
>