uschindler commented on code in PR #12183:
URL: https://github.com/apache/lucene/pull/12183#discussion_r1125014135
##########
lucene/core/src/java/org/apache/lucene/search/FieldExistsQuery.java:
##########
@@ -110,59 +116,91 @@ public int hashCode() {
@Override
public Query rewrite(IndexSearcher indexSearcher) throws IOException {
IndexReader reader = indexSearcher.getIndexReader();
- boolean allReadersRewritable = true;
+ final List<FutureTask<Boolean>> tasks =
+ reader.leaves().stream()
+ .map(
+ ctx ->
+ new FutureTask<>(
+ () -> {
+ AtomicBoolean allReadersRewritable = new
AtomicBoolean(true);
+ LeafReader leaf = ctx.reader();
+ FieldInfos fieldInfos = leaf.getFieldInfos();
+ FieldInfo fieldInfo = fieldInfos.fieldInfo(field);
+ if (fieldInfo == null) {
+ allReadersRewritable.set(false);
+ return allReadersRewritable.get();
+ }
Review Comment:
FiekdExistsQuery is cheap in general. No need to parallelize anything. Sorry
this makes no sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]