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 Mark Allan <ma...@ed.ac.uk> on 2010/07/29 11:49:18 UTC
Reference shards by alias
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.
Re: Reference shards by alias
Posted by Mark Allan <ma...@ed.ac.uk>.
On 29 Jul 2010, at 12:27 pm, Gora Mohanty wrote:
> On Thu, 29 Jul 2010 10:49:18 +0100
> Mark Allan <ma...@ed.ac.uk> 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.
Re: Reference shards by alias
Posted by Gora Mohanty <go...@srijan.in>.
On Thu, 29 Jul 2010 10:49:18 +0100
Mark Allan <ma...@ed.ac.uk> 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