Commit f50725e
authored
Remove TopDocsCollectorContext#shouldRescore method (elastic#94895)
QueryPhase#executeInternal returns a boolean that tells whether we
should rescore. That one is returned by searchWithCollector which in
turn is returned by TopDocsCollectorContext#shouldRescore which returns
false by default and the only subclass that overrides it returns whether
the search context had a rescorer configured.
We can simplify this by pulling out the logic that we use to make the decision on whether to execute the rescore phase or not, and remove the shouldRescore method and return value that gets carried around which adds complexity.1 parent c787e38 commit f50725e
File tree
4 files changed
+12
-33
lines changed- server/src
- main/java/org/elasticsearch/search
- query
- rescore
- test/java/org/elasticsearch/search/query
4 files changed
+12
-33
lines changedLines changed: 5 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
96 | | - | |
97 | 94 | | |
98 | | - | |
| 95 | + | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| |||
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
179 | | - | |
| 176 | + | |
180 | 177 | | |
181 | 178 | | |
182 | 179 | | |
| |||
185 | 182 | | |
186 | 183 | | |
187 | 184 | | |
188 | | - | |
189 | 185 | | |
190 | 186 | | |
191 | 187 | | |
| |||
198 | 194 | | |
199 | 195 | | |
200 | 196 | | |
201 | | - | |
| 197 | + | |
202 | 198 | | |
203 | 199 | | |
204 | 200 | | |
| |||
238 | 234 | | |
239 | 235 | | |
240 | 236 | | |
241 | | - | |
242 | 237 | | |
243 | 238 | | |
244 | 239 | | |
| |||
Lines changed: 2 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 77 | | |
92 | 78 | | |
93 | 79 | | |
| |||
188 | 174 | | |
189 | 175 | | |
190 | 176 | | |
191 | | - | |
| 177 | + | |
192 | 178 | | |
193 | 179 | | |
194 | 180 | | |
| |||
479 | 465 | | |
480 | 466 | | |
481 | 467 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 468 | + | |
488 | 469 | | |
489 | 470 | | |
490 | 471 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
0 commit comments