Harald
Harald

Reputation: 5113

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?

Upvotes: 6

Views: 1404

Answers (1)

MYK
MYK

Reputation: 845

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

Upvotes: 8

Related Questions