add index_where index_when func in core