6

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?

Harald
  • 4,575
  • 5
  • 33
  • 72

1 Answers1

8

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

MYK
  • 825
  • 12
  • 25