Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SolrCloud: Is it possible to get the shard id of a document in the search results

When debugging Solr schema and indexing in a SolrCloud, it is important to easily know into which shard a document was indexed. Is it possible to define a schema field for the shard id such that the automatically assigned shard id is then available in search results?

like image 856
Harald Avatar asked Jun 23 '14 08:06

Harald


1 Answers

You dont need to store shard id in your schema explicitly to get it in results. if in fl parameter you add [shard] with other required fields, it will return you the shard id of that document:

/solr/collection_name/select?q=*:*&fl=[shard],*&wt=json&indent=true

like image 118
MYK Avatar answered Nov 15 '22 11:11

MYK