rmuir commented on code in PR #12183:
URL: https://github.com/apache/lucene/pull/12183#discussion_r1124999096
##########
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:
nothing here does any actual IO (e.g. seek to any terms), so there is no
point in doing it concurrently. it is really just checking some in-ram metadata.
--
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]