Reference shards by alias

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reference shards by alias

Mark Allan
Hi all,

We're building a service which will have data from a number of  
different providers, but the data from each will be slightly  
different.  We've decided to keep the data separate by using multiple  
cores in Solr; one for each provider. There will be enough overlap in  
the data to allow searching across all cores in some instances but not  
others, so we'll be building up the shards parameter in our user  
interface and would like not to have to hard-code hosts/ports/paths.

Is there a way to reference each core/shard by name rather than  
explicitly stating the host, port and path in the URL?  For example,  
I'd like to swap:
        http://localhost:8983/solr/core0/select/?
q=foo<..snip..>&shards=localhost:8983/solr/core0,localhost:8983/solr/
core1,...
for something like:
        http://localhost:8983/solr/core0/select/?
q=foo<..snip..>&shards=stills,video,etc...
and have it do the same thing.

Many thanks,
Mark

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply | Threaded
Open this post in threaded view
|

Re: Reference shards by alias

Gora Mohanty-2
On Thu, 29 Jul 2010 10:49:18 +0100
Mark Allan <[hidden email]> wrote:
[...]

> Is there a way to reference each core/shard by name rather than  
> explicitly stating the host, port and path in the URL?  For
> example, I'd like to swap:
> http://localhost:8983/solr/core0/select/?
> q=foo<..snip..>&shards=localhost:8983/solr/core0,localhost:8983/solr/
> core1,...
> for something like:
> http://localhost:8983/solr/core0/select/?
> q=foo<..snip..>&shards=stills,video,etc...
> and have it do the same thing.
[...]

If you are using Apache, mod_rewrite will let you do all kinds of
fancy things in terms of rewriting URLs.

Regards,
Gora
Reply | Threaded
Open this post in threaded view
|

Re: Reference shards by alias

Mark Allan

On 29 Jul 2010, at 12:27 pm, Gora Mohanty wrote:

> On Thu, 29 Jul 2010 10:49:18 +0100
> Mark Allan <[hidden email]> wrote:
> [...]
>> Is there a way to reference each core/shard by name rather than
>> explicitly stating the host, port and path in the URL?  For
>> example, I'd like to swap:
>> http://localhost:8983/solr/core0/select/?
>> q=foo<..snip..>&shards=localhost:8983/solr/core0,localhost:8983/solr/
>> core1,...
>> for something like:
>> http://localhost:8983/solr/core0/select/?
>> q=foo<..snip..>&shards=stills,video,etc...
>> and have it do the same thing.
> [...]
>
> If you are using Apache, mod_rewrite will let you do all kinds of
> fancy things in terms of rewriting URLs.

Hmm, that's a very good point.  We'll probably be deploying to Tomcat  
eventually, but I'll bear it in mind.  Thanks

Mark

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.