mbien commented on code in PR #3558:
URL: https://github.com/apache/netbeans/pull/3558#discussion_r841294028


##########
java/maven.indexer/src/org/apache/lucene/search/MultiTermQuery.java:
##########
@@ -0,0 +1,366 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.search;
+
+
+import java.io.IOException;
+import java.util.Objects;
+import java.util.logging.Logger;
+
+import org.apache.lucene.index.FilteredTermsEnum; // javadocs
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.SingleTermsEnum;   // javadocs
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermStates;
+import org.apache.lucene.index.Terms;
+import org.apache.lucene.index.TermsEnum;
+import org.apache.lucene.search.BooleanQuery.Builder;
+import org.apache.lucene.util.AttributeSource;
+import org.apache.lucene.util.Version;
+
+/**
+ * An abstract {@link Query} that matches documents
+ * containing a subset of terms provided by a {@link
+ * FilteredTermsEnum} enumeration.
+ *
+ * <p>This query cannot be used directly; you must subclass
+ * it and define {@link #getTermsEnum(Terms,AttributeSource)} to provide a 
{@link
+ * FilteredTermsEnum} that iterates through the terms to be
+ * matched.
+ *
+ * <p><b>NOTE</b>: if {@link #setRewriteMethod} is either
+ * {@link #CONSTANT_SCORE_BOOLEAN_REWRITE} or {@link
+ * #SCORING_BOOLEAN_REWRITE}, you may encounter a
+ * {@link BooleanQuery.TooManyClauses} exception during
+ * searching, which happens when the number of terms to be
+ * searched exceeds {@link
+ * BooleanQuery#getMaxClauseCount()}.  Setting {@link
+ * #setRewriteMethod} to {@link #CONSTANT_SCORE_REWRITE}
+ * prevents this.
+ *
+ * <p>The recommended rewrite method is {@link
+ * #CONSTANT_SCORE_REWRITE}: it doesn't spend CPU
+ * computing unhelpful scores, and is the most
+ * performant rewrite method given the query. If you
+ * need scoring (like {@link FuzzyQuery}, use
+ * {@link TopTermsScoringBooleanQueryRewrite} which uses
+ * a priority queue to only collect competitive terms
+ * and not hit this limitation.
+ *
+ * Note that org.apache.lucene.queryparser.classic.QueryParser produces
+ * MultiTermQueries using {@link #CONSTANT_SCORE_REWRITE}
+ * by default.
+ */

Review Comment:
   comment is there. Should i move it to the very top of the file? Its over the 
secretInit() method, right where the assert is which would fail on next lucene 
upgrade, see 
https://github.com/apache/netbeans/pull/3558#issuecomment-1086785298.



-- 
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]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to