Alfred Francis
Alfred Francis

Reputation: 451

How to Split Solr collection into shards based on Date field

I'm trying to split my solrcloud collection into shards based on date field. ie, Documents should be routed to different shards based on the year in the date field. As of now im using compositeid sharding. How can i approach this ?

Upvotes: 0

Views: 429

Answers (1)

Persimmonium
Persimmonium

Reputation: 15789

then you just use the following compositeId:

  • assume tid is the field of the doc uniquely identifying it
  • extract the YEAR from the date
  • compositeid is: YEAR!tid

Upvotes: 1

Related Questions