About Index Shard Allocation

I want to custome index shard rules, for example, I created a called productindex index on one node , divided into 5 shard, which has a “type” attribute, I want to control my index according to the value of the type attribute .
who tell me how i shoud do?