@@ -100,7 +100,7 @@ public void setNextReader(LeafReaderContext readerContext) throws IOException {
100100 public boolean advanceExact (int target ) throws IOException {
101101 if (sorted .advanceExact (target )) {
102102 if (sorted .docValueCount () > 1 ) {
103- throw new IllegalStateException (
103+ throw new IllegalArgumentException (
104104 "failed to extract doc:" + target + ", the grouping field must be single valued"
105105 );
106106 }
@@ -124,7 +124,7 @@ public long longValue() throws IOException {
124124 };
125125 }
126126 }
127- default -> throw new IllegalStateException ("unexpected doc values type " + type + "` for field `" + field + "`" );
127+ default -> throw new IllegalArgumentException ("unexpected doc values type " + type + "` for field `" + field + "`" );
128128 }
129129 }
130130
@@ -201,7 +201,7 @@ public boolean advanceExact(int target) throws IOException {
201201 if (sorted .advanceExact (target )) {
202202 ord = (int ) sorted .nextOrd ();
203203 if (sorted .nextOrd () != SortedSetDocValues .NO_MORE_ORDS ) {
204- throw new IllegalStateException (
204+ throw new IllegalArgumentException (
205205 "failed to extract doc:" + target + ", the grouping field must be single valued"
206206 );
207207 }
@@ -233,7 +233,7 @@ public int getValueCount() {
233233 };
234234 }
235235 }
236- default -> throw new IllegalStateException ("unexpected doc values type " + type + "` for field `" + field + "`" );
236+ default -> throw new IllegalArgumentException ("unexpected doc values type " + type + "` for field `" + field + "`" );
237237 }
238238 }
239239
0 commit comments