You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by ufuk yılmaz <uy...@vivaldi.net.INVALID> on 2021/06/10 21:55:06 UTC
Return name of the collection/core with the document
Is it possible to return which collection a matching document came from, when querying against an alias?
Suppose alias “myAlias” is pointing to collections c1, c2 and c3 and we are querying:
/solr/myAlias?q=id:123
I’m trying to get a response similar to:
[{ “id”: 123, “collection”: “c2”}]
Core name, shard name would be useful too, since I can extract collection name from them.
Is this achievable?
Thanks
~ufuk
Sent from Mail for Windows 10
RE: Return name of the collection/core with the document
Posted by ufuk yılmaz <uy...@vivaldi.net.INVALID>.
I tried it but shards.info returned all shard information of all collections in the alias, not just where the document came from. I still don’t know which collection the response docs came from.
Sent from Mail for Windows 10
From: Jan Høydahl
Sent: 11 June 2021 12:44
To: users@solr.apache.org
Subject: Re: Return name of the collection/core with the document
Try to add shards.info=true to your request, and you should get the core name in the response..
Jan
> 10. jun. 2021 kl. 23:55 skrev ufuk yılmaz <uy...@vivaldi.net.INVALID>:
>
> Is it possible to return which collection a matching document came from, when querying against an alias?
>
> Suppose alias “myAlias” is pointing to collections c1, c2 and c3 and we are querying:
>
> /solr/myAlias?q=id:123
>
> I’m trying to get a response similar to:
>
> [{ “id”: 123, “collection”: “c2”}]
>
> Core name, shard name would be useful too, since I can extract collection name from them.
>
> Is this achievable?
>
> Thanks
> ~ufuk
>
> Sent from Mail for Windows 10
>
Re: Return name of the collection/core with the document
Posted by Jan Høydahl <ja...@cominvent.com>.
Try to add shards.info=true to your request, and you should get the core name in the response..
Jan
> 10. jun. 2021 kl. 23:55 skrev ufuk yılmaz <uy...@vivaldi.net.INVALID>:
>
> Is it possible to return which collection a matching document came from, when querying against an alias?
>
> Suppose alias “myAlias” is pointing to collections c1, c2 and c3 and we are querying:
>
> /solr/myAlias?q=id:123
>
> I’m trying to get a response similar to:
>
> [{ “id”: 123, “collection”: “c2”}]
>
> Core name, shard name would be useful too, since I can extract collection name from them.
>
> Is this achievable?
>
> Thanks
> ~ufuk
>
> Sent from Mail for Windows 10
>