lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [02/21] lucenenet git commit: Lucene.Net.Core.BooleanQuery.TooManyClauses: Renamed TooManyClausesException
Date Sun, 12 Mar 2017 16:38:01 GMT
Lucene.Net.Core.BooleanQuery.TooManyClauses: Renamed TooManyClausesException


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/38319a5c
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/38319a5c
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/38319a5c

Branch: refs/heads/api-work
Commit: 38319a5c15aa50096bbf1676a68f184572daae39
Parents: e47afa4
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sat Mar 11 15:43:51 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sat Mar 11 15:43:51 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/BooleanQuery.cs      | 10 +++---
 src/Lucene.Net.Core/Search/IndexSearcher.cs     | 34 ++++++++++----------
 src/Lucene.Net.Core/Search/MultiTermQuery.cs    |  4 +--
 src/Lucene.Net.Core/Search/ScoringRewrite.cs    |  2 +-
 src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs      |  2 +-
 .../Classic/QueryParserBase.cs                  |  4 +--
 .../Standard/Builders/AnyQueryNodeBuilder.cs    |  2 +-
 .../Builders/BooleanQueryNodeBuilder.cs         |  2 +-
 .../Builders/StandardBooleanQueryNodeBuilder.cs |  2 +-
 .../Search/TestMultiTermQueryRewrites.cs        |  2 +-
 10 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.Core/Search/BooleanQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/BooleanQuery.cs b/src/Lucene.Net.Core/Search/BooleanQuery.cs
index cc8781f..3fca2fc 100644
--- a/src/Lucene.Net.Core/Search/BooleanQuery.cs
+++ b/src/Lucene.Net.Core/Search/BooleanQuery.cs
@@ -51,9 +51,9 @@ namespace Lucene.Net.Search
 #if FEATURE_SERIALIZABLE
         [Serializable]
 #endif
-        public class TooManyClauses : Exception // LUCENENET TODO: Rename TooManyClausesException
? (.NET convention)
+        public class TooManyClausesException : Exception // LUCENENET specific - added Exception
suffix
         {
-            public TooManyClauses()
+            public TooManyClausesException()
                 : base("maxClauseCount is set to " + maxClauseCount)
             {
             }
@@ -149,7 +149,7 @@ namespace Lucene.Net.Search
         /// <summary>
         /// Adds a clause to a boolean query.
         /// </summary>
-        /// <exception cref="TooManyClauses"> if the new number of clauses exceeds
the maximum clause number </exception>
+        /// <exception cref="TooManyClausesException"> if the new number of clauses
exceeds the maximum clause number </exception>
         /// <seealso cref= #getMaxClauseCount() </seealso>
         public virtual void Add(Query query, Occur occur)
         {
@@ -158,13 +158,13 @@ namespace Lucene.Net.Search
 
         /// <summary>
         /// Adds a clause to a boolean query. </summary>
-        /// <exception cref="TooManyClauses"> if the new number of clauses exceeds
the maximum clause number </exception>
+        /// <exception cref="TooManyClausesException"> if the new number of clauses
exceeds the maximum clause number </exception>
         /// <seealso cref= #getMaxClauseCount() </seealso>
         public virtual void Add(BooleanClause clause)
         {
             if (clauses.Count >= maxClauseCount)
             {
-                throw new TooManyClauses();
+                throw new TooManyClausesException();
             }
 
             clauses.Add(clause);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.Core/Search/IndexSearcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/IndexSearcher.cs b/src/Lucene.Net.Core/Search/IndexSearcher.cs
index 1130580..ba543b9 100644
--- a/src/Lucene.Net.Core/Search/IndexSearcher.cs
+++ b/src/Lucene.Net.Core/Search/IndexSearcher.cs
@@ -252,7 +252,7 @@ namespace Lucene.Net.Search
         /// this method can be used for efficient 'deep-paging' across potentially
         /// large result sets.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs SearchAfter(ScoreDoc after, Query query, int n)
         {
@@ -268,7 +268,7 @@ namespace Lucene.Net.Search
         /// this method can be used for efficient 'deep-paging' across potentially
         /// large result sets.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs SearchAfter(ScoreDoc after, Query query, Filter filter, int
n)
         {
@@ -279,7 +279,7 @@ namespace Lucene.Net.Search
         /// Finds the top <code>n</code>
         /// hits for <code>query</code>.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs Search(Query query, int n)
         {
@@ -290,7 +290,7 @@ namespace Lucene.Net.Search
         /// Finds the top <code>n</code>
         /// hits for <code>query</code>, applying <code>filter</code>
if non-null.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs Search(Query query, Filter filter, int n)
         {
@@ -306,7 +306,7 @@ namespace Lucene.Net.Search
         /// <param name="query"> to match documents </param>
         /// <param name="filter"> if non-null, used to permit documents to be collected.
</param>
         /// <param name="results"> to receive hits </param>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual void Search(Query query, Filter filter, ICollector results)
         {
@@ -318,7 +318,7 @@ namespace Lucene.Net.Search
         ///
         /// <p><seealso cref="ICollector#collect(int)"/> is called for every
matching document.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual void Search(Query query, ICollector results)
         {
@@ -335,7 +335,7 @@ namespace Lucene.Net.Search
         /// <seealso cref="IndexSearcher#search(Query,Filter,int,Sort,boolean,boolean)"/>
to
         /// control scoring.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopFieldDocs Search(Query query, Filter filter, int n, Sort sort)
         {
@@ -354,7 +354,7 @@ namespace Lucene.Net.Search
         /// <code>true</code> then the maximum score over all
         /// collected hits will be computed.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopFieldDocs Search(Query query, Filter filter, int n, Sort sort,
bool doDocScores, bool doMaxScore)
         {
@@ -370,7 +370,7 @@ namespace Lucene.Net.Search
         /// this method can be used for efficient 'deep-paging' across potentially
         /// large result sets.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs SearchAfter(ScoreDoc after, Query query, Filter filter, int
n, Sort sort)
         {
@@ -404,7 +404,7 @@ namespace Lucene.Net.Search
         /// this method can be used for efficient 'deep-paging' across potentially
         /// large result sets.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs SearchAfter(ScoreDoc after, Query query, int n, Sort sort)
         {
@@ -431,7 +431,7 @@ namespace Lucene.Net.Search
         /// <code>true</code> then the maximum score over all
         /// collected hits will be computed.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual TopDocs SearchAfter(ScoreDoc after, Query query, Filter filter, int
n, Sort sort, bool doDocScores, bool doMaxScore)
         {
@@ -450,7 +450,7 @@ namespace Lucene.Net.Search
         ///
         /// <p>Applications should usually call <seealso cref="IndexSearcher#search(Query,int)"/>
or
         /// <seealso cref="IndexSearcher#search(Query,Filter,int)"/> instead. </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         protected virtual TopDocs Search(Weight weight, ScoreDoc after, int nDocs)
         {
@@ -507,7 +507,7 @@ namespace Lucene.Net.Search
         ///
         /// <p>Applications should usually call <seealso cref="IndexSearcher#search(Query,int)"/>
or
         /// <seealso cref="IndexSearcher#search(Query,Filter,int)"/> instead. </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         protected virtual TopDocs Search(IList<AtomicReaderContext> leaves, Weight
weight, ScoreDoc after, int nDocs)
         {
@@ -533,7 +533,7 @@ namespace Lucene.Net.Search
         /// <p>Applications should usually call {@link
         /// IndexSearcher#search(Query,Filter,int,Sort)} instead.
         /// </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         protected virtual TopFieldDocs Search(Weight weight, int nDocs, Sort sort, bool doDocScores,
bool doMaxScore)
         {
@@ -627,7 +627,7 @@ namespace Lucene.Net.Search
         ///          to match documents </param>
         /// <param name="collector">
         ///          to receive hits </param>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         protected virtual void Search(IList<AtomicReaderContext> leaves, Weight weight,
ICollector collector)
         {
@@ -664,7 +664,7 @@ namespace Lucene.Net.Search
 
         /// <summary>
         /// Expert: called to re-write queries into primitive queries. </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         public virtual Query Rewrite(Query original)
         {
@@ -700,7 +700,7 @@ namespace Lucene.Net.Search
         /// Computing an explanation is as expensive as executing the query over the
         /// entire index.
         /// <p>Applications should call <seealso cref="IndexSearcher#explain(Query,
int)"/>. </summary>
-        /// <exception cref="BooleanQuery.TooManyClauses"> If a query would exceed
+        /// <exception cref="BooleanQuery.TooManyClausesException"> If a query would
exceed
         ///         <seealso cref="BooleanQuery#getMaxClauseCount()"/> clauses. </exception>
         protected virtual Explanation Explain(Weight weight, int doc)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.Core/Search/MultiTermQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/MultiTermQuery.cs b/src/Lucene.Net.Core/Search/MultiTermQuery.cs
index 95556e0..2fac386 100644
--- a/src/Lucene.Net.Core/Search/MultiTermQuery.cs
+++ b/src/Lucene.Net.Core/Search/MultiTermQuery.cs
@@ -39,7 +39,7 @@ namespace Lucene.Net.Search
     /// <p><b>NOTE</b>: if <seealso cref="#setRewriteMethod"/> is
either
     /// <seealso cref="#CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE"/> or {@link
     /// #SCORING_BOOLEAN_QUERY_REWRITE}, you may encounter a
-    /// <seealso cref="BooleanQuery.TooManyClauses"/> exception during
+    /// <seealso cref="BooleanQuery.TooManyClausesException"/> exception during
     /// searching, which happens when the number of terms to be
     /// searched exceeds {@link
     /// BooleanQuery#getMaxClauseCount()}.  Setting {@link
@@ -88,7 +88,7 @@ namespace Lucene.Net.Search
         ///  <p> this method is faster than the BooleanQuery
         ///  rewrite methods when the number of matched terms or
         ///  matched documents is non-trivial. Also, it will never
-        ///  hit an errant <seealso cref="BooleanQuery.TooManyClauses"/>
+        ///  hit an errant <seealso cref="BooleanQuery.TooManyClausesException"/>
         ///  exception.
         /// </summary>
         ///  <seealso cref= #setRewriteMethod  </seealso>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.Core/Search/ScoringRewrite.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/ScoringRewrite.cs b/src/Lucene.Net.Core/Search/ScoringRewrite.cs
index 17d7c56..340b192 100644
--- a/src/Lucene.Net.Core/Search/ScoringRewrite.cs
+++ b/src/Lucene.Net.Core/Search/ScoringRewrite.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Search
             {
                 if (count > BooleanQuery.MaxClauseCount)
                 {
-                    throw new BooleanQuery.TooManyClauses();
+                    throw new BooleanQuery.TooManyClausesException();
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
index f4d32c8..16b2fe0 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
@@ -402,7 +402,7 @@ namespace Lucene.Net.Queries.Mlt
                 {
                     query.Add(tq, Occur.SHOULD);
                 }
-                catch (BooleanQuery.TooManyClauses)
+                catch (BooleanQuery.TooManyClausesException)
                 {
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
index a919140..4599e43 100644
--- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
+++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
@@ -179,7 +179,7 @@ namespace Lucene.Net.QueryParsers.Classic
             {
                 throw new ParseException("Cannot parse '" + query + "': " + tme.Message,
tme);
             }
-            catch (BooleanQuery.TooManyClauses tmc)
+            catch (BooleanQuery.TooManyClausesException tmc)
             {
                 throw new ParseException("Cannot parse '" + query + "': too many boolean
clauses", tmc);
             }
@@ -256,7 +256,7 @@ namespace Lucene.Net.QueryParsers.Classic
         /// By default QueryParser uses <see cref="MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT"/>
         /// when creating a <see cref="PrefixQuery"/>, <see cref="WildcardQuery"/>
or <see cref="TermRangeQuery"/>. This implementation is generally preferable because
it
         /// a) Runs faster b) Does not have the scarcity of terms unduly influence score
-        /// c) avoids any <see cref="BooleanQuery.TooManyClauses"/> exception.
+        /// c) avoids any <see cref="BooleanQuery.TooManyClausesException"/> exception.
         /// However, if your application really needs to use the
         /// old-fashioned <see cref="BooleanQuery"/> expansion rewriting and the above
         /// points are not relevant then use this to change

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
index faa0d66..339cb09 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/AnyQueryNodeBuilder.cs
@@ -57,7 +57,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
                         {
                             bQuery.Add(query, Occur.SHOULD);
                         }
-                        catch (BooleanQuery.TooManyClauses ex)
+                        catch (BooleanQuery.TooManyClausesException ex)
                         {
                             throw new QueryNodeException(new Message(
                                 /*

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
index 170b802..63f4de5 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/BooleanQueryNodeBuilder.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
                         {
                             bQuery.Add(query, GetModifierValue(child));
                         }
-                        catch (BooleanQuery.TooManyClauses ex)
+                        catch (BooleanQuery.TooManyClausesException ex)
                         {
                             throw new QueryNodeException(new Message(
                                 QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
index b79c96e..b145c0c 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Builders/StandardBooleanQueryNodeBuilder.cs
@@ -63,7 +63,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Builders
                         {
                             bQuery.Add(query, GetModifierValue(child));
                         }
-                        catch (BooleanQuery.TooManyClauses ex)
+                        catch (BooleanQuery.TooManyClausesException ex)
                         {
                             throw new QueryNodeException(new Message(
                                 QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38319a5c/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs b/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs
index ec907df..8f681c5 100644
--- a/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs
+++ b/src/Lucene.Net.Tests/Search/TestMultiTermQueryRewrites.cs
@@ -265,7 +265,7 @@ namespace Lucene.Net.Search
                 MultiSearcherDupls.Rewrite(mtq);
                 Assert.Fail("Should throw BooleanQuery.TooManyClauses");
             }
-            catch (BooleanQuery.TooManyClauses e)
+            catch (BooleanQuery.TooManyClausesException e)
             {
                 //  Maybe remove this assert in later versions, when internal API changes:
                 Assert.AreEqual("CheckMaxClauseCount", new StackTrace(e, false).GetFrames()[0].GetMethod().Name);
//, "Should throw BooleanQuery.TooManyClauses with a stacktrace containing checkMaxClauseCount()");


Mime
View raw message