File tree Expand file tree Collapse file tree
server/src/main/java/org/elasticsearch/cluster/routing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,8 +221,6 @@ public MurmurHash3.Hash128 hash() {
221221 }
222222
223223 public final BytesRef buildTsid (IndexVersion indexVersion ) {
224- throwIfEmpty ();
225- Collections .sort (dimensions );
226224 if (indexVersion .onOrAfter (IndexVersions .CLUSTERING_TSID )) {
227225 return buildClusteringTsid ();
228226 } else {
@@ -253,6 +251,9 @@ public final BytesRef buildTsid(IndexVersion indexVersion) {
253251 * @throws IllegalArgumentException if no dimensions have been added
254252 */
255253 public BytesRef buildLegacyTsid () {
254+ throwIfEmpty ();
255+ Collections .sort (dimensions );
256+
256257 int numberOfValues = Math .min (MAX_TSID_VALUE_SIMILARITY_FIELDS , dimensions .size ());
257258 byte [] hash = new byte [1 + numberOfValues + 16 ];
258259 int index = 0 ;
@@ -293,6 +294,9 @@ public BytesRef buildLegacyTsid() {
293294 }
294295
295296 private BytesRef buildClusteringTsid () {
297+ throwIfEmpty ();
298+ Collections .sort (dimensions );
299+
296300 final byte [] tsid = new byte [16 ];
297301 murmur3Hasher .reset ();
298302 MurmurHash3 .Hash128 hashBuffer = new MurmurHash3 .Hash128 ();
You can’t perform that action at this time.
0 commit comments