From 3f86e8cf864c407b29a101e9c4f4a0a4cf958c85 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Mon, 19 Sep 2016 11:25:21 +0700 Subject: [PATCH 01/11] Changed default namespace of QueryParser to QueryParsers to avoid namespace/class name collisions. --- .../Analyzing/AnalyzingQueryParser.cs | 4 ++-- src/Lucene.Net.QueryParser/Classic/CharStream.cs | 2 +- src/Lucene.Net.QueryParser/Classic/FastCharStream.cs | 2 +- src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs | 2 +- src/Lucene.Net.QueryParser/Classic/ParseException.cs | 2 +- src/Lucene.Net.QueryParser/Classic/QueryParser.cs | 2 +- src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs | 4 ++-- src/Lucene.Net.QueryParser/Classic/QueryParserConstants.cs | 2 +- .../Classic/QueryParserTokenManager.cs | 2 +- src/Lucene.Net.QueryParser/Classic/Token.cs | 2 +- src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs | 2 +- .../ComplexPhrase/ComplexPhraseQueryParser.cs | 4 ++-- src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs | 2 +- src/Lucene.Net.QueryParser/Ext/ExtensionQuery.cs | 2 +- src/Lucene.Net.QueryParser/Ext/Extensions.cs | 4 ++-- src/Lucene.Net.QueryParser/Ext/ParserExtension.cs | 4 ++-- .../Flexible/Standard/CommonQueryParserConfiguration.cs | 2 +- src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj | 2 +- src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs | 2 +- .../Surround/Parser/FastCharStream.cs | 2 +- .../Surround/Parser/ParseException.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs | 4 ++-- .../Surround/Parser/QueryParserConstants.cs | 2 +- .../Surround/Parser/QueryParserTokenManager.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Parser/Token.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/AndQuery.cs | 2 +- .../Surround/Query/BasicQueryFactory.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs | 2 +- .../Surround/Query/DistanceRewriteQuery.cs | 2 +- .../Surround/Query/DistanceSubQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/FieldsQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/NotQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/OrQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs | 2 +- .../Surround/Query/SimpleTermRewriteQuery.cs | 2 +- .../Surround/Query/SpanNearClauseFactory.cs | 2 +- .../Surround/Query/SrndBooleanQuery.cs | 2 +- .../Surround/Query/SrndPrefixQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/SrndTermQuery.cs | 2 +- src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs | 2 +- .../Surround/Query/TooManyBasicQueries.cs | 2 +- src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj | 2 +- .../Analyzing/TestAnalyzingQueryParser.cs | 4 ++-- .../Classic/TestMultiAnalyzer.cs | 2 +- .../Classic/TestMultiFieldQueryParser.cs | 2 +- .../Classic/TestMultiPhraseQueryParsing.cs | 2 +- src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs | 6 +++--- .../ComplexPhrase/TestComplexPhraseQuery.cs | 2 +- src/Lucene.Net.Tests.QueryParser/Ext/ExtensionStub.cs | 2 +- .../Ext/TestExtendableQueryParser.cs | 4 ++-- src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs | 2 +- .../Lucene.Net.Tests.QueryParser.csproj | 2 +- .../Simple/TestSimpleQueryParser.cs | 2 +- .../Surround/Query/BooleanQueryTst.cs | 2 +- .../Surround/Query/ExceptionQueryTst.cs | 4 ++-- .../Surround/Query/SingleFieldTestDb.cs | 2 +- .../Surround/Query/SrndQueryTest.cs | 2 +- .../Surround/Query/Test01Exceptions.cs | 2 +- .../Surround/Query/Test02Boolean.cs | 2 +- .../Surround/Query/Test03Distance.cs | 2 +- .../Util/QueryParserTestBase.cs | 6 +++--- 66 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs b/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs index a98a26d592..68a22e3b38 100644 --- a/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs @@ -1,12 +1,12 @@ using Lucene.Net.Analysis; using Lucene.Net.Analysis.Tokenattributes; -using Lucene.Net.QueryParser.Classic; +using Lucene.Net.QueryParsers.Classic; using Lucene.Net.Search; using Lucene.Net.Util; using System.Text; using System.Text.RegularExpressions; -namespace Lucene.Net.QueryParser.Analyzing +namespace Lucene.Net.QueryParsers.Analyzing { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/CharStream.cs b/src/Lucene.Net.QueryParser/Classic/CharStream.cs index 8d0fc3aa54..32294a8b79 100644 --- a/src/Lucene.Net.QueryParser/Classic/CharStream.cs +++ b/src/Lucene.Net.QueryParser/Classic/CharStream.cs @@ -1,6 +1,6 @@ using System; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs b/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs index b4da56838e..c8c320461c 100644 --- a/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs +++ b/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs @@ -1,6 +1,6 @@ using System; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs b/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs index 63388575c9..befda3185d 100644 --- a/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs @@ -3,7 +3,7 @@ using Lucene.Net.Util; using System.Collections.Generic; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/ParseException.cs b/src/Lucene.Net.QueryParser/Classic/ParseException.cs index e9cccb4608..835c4f47ba 100644 --- a/src/Lucene.Net.QueryParser/Classic/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Classic/ParseException.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs index d8f5ca924b..64878e94a5 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.IO; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs index 0b872aedc9..a6103f2922 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs @@ -2,7 +2,7 @@ using Lucene.Net.Analysis.Tokenattributes; using Lucene.Net.Documents; using Lucene.Net.Index; -using Lucene.Net.QueryParser.Flexible.Standard; +using Lucene.Net.QueryParsers.Flexible.Standard; using Lucene.Net.Search; using Lucene.Net.Support; using Lucene.Net.Util; @@ -12,7 +12,7 @@ using System.IO; using System.Text; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserConstants.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserConstants.cs index 29df459dbf..7687dfee9a 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserConstants.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserConstants.cs @@ -1,4 +1,4 @@ -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs index ca7f2f4e85..409a33e745 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs @@ -2,7 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.IO; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/Token.cs b/src/Lucene.Net.QueryParser/Classic/Token.cs index 389e7b39cd..a94317c728 100644 --- a/src/Lucene.Net.QueryParser/Classic/Token.cs +++ b/src/Lucene.Net.QueryParser/Classic/Token.cs @@ -1,6 +1,6 @@ using System; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs b/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs index a5ef460440..d7da9773e2 100644 --- a/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs +++ b/src/Lucene.Net.QueryParser/Classic/TokenMgrError.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs b/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs index fb307530a0..037dcd3288 100644 --- a/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs +++ b/src/Lucene.Net.QueryParser/ComplexPhrase/ComplexPhraseQueryParser.cs @@ -1,6 +1,6 @@ using Lucene.Net.Analysis; using Lucene.Net.Index; -using Lucene.Net.QueryParser.Classic; +using Lucene.Net.QueryParsers.Classic; using Lucene.Net.Search; using Lucene.Net.Search.Spans; using Lucene.Net.Util; @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Linq; -namespace Lucene.Net.QueryParser.ComplexPhrase +namespace Lucene.Net.QueryParsers.ComplexPhrase { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs b/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs index ee45f170f9..b33ce13147 100644 --- a/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs @@ -3,7 +3,7 @@ using Lucene.Net.Util; using System; -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Ext/ExtensionQuery.cs b/src/Lucene.Net.QueryParser/Ext/ExtensionQuery.cs index fc86c2ec1d..9cedbe9112 100644 --- a/src/Lucene.Net.QueryParser/Ext/ExtensionQuery.cs +++ b/src/Lucene.Net.QueryParser/Ext/ExtensionQuery.cs @@ -1,4 +1,4 @@ -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Ext/Extensions.cs b/src/Lucene.Net.QueryParser/Ext/Extensions.cs index af6146ced2..f441850e9f 100644 --- a/src/Lucene.Net.QueryParser/Ext/Extensions.cs +++ b/src/Lucene.Net.QueryParser/Ext/Extensions.cs @@ -1,9 +1,9 @@ -using Lucene.Net.QueryParser.Classic; +using Lucene.Net.QueryParsers.Classic; using System; using System.Collections.Generic; using System.Text; -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Ext/ParserExtension.cs b/src/Lucene.Net.QueryParser/Ext/ParserExtension.cs index 27b921265d..b61705977b 100644 --- a/src/Lucene.Net.QueryParser/Ext/ParserExtension.cs +++ b/src/Lucene.Net.QueryParser/Ext/ParserExtension.cs @@ -1,7 +1,7 @@ -using Lucene.Net.QueryParser.Classic; +using Lucene.Net.QueryParsers.Classic; using Lucene.Net.Search; -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/CommonQueryParserConfiguration.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/CommonQueryParserConfiguration.cs index ae3809f8e3..35ec10325e 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/CommonQueryParserConfiguration.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/CommonQueryParserConfiguration.cs @@ -4,7 +4,7 @@ using System; using System.Globalization; -namespace Lucene.Net.QueryParser.Flexible.Standard +namespace Lucene.Net.QueryParsers.Flexible.Standard { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj b/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj index e3f8fc6829..8a339abdc2 100644 --- a/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj +++ b/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj @@ -7,7 +7,7 @@ {949BA34B-6AE6-4CE3-B578-61E13E4D76BF} Library Properties - Lucene.Net.QueryParser + Lucene.Net.QueryParsers Lucene.Net.QueryParser v4.5.1 512 diff --git a/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs index 8964d56fa3..3c8c694e0c 100644 --- a/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Simple/SimpleQueryParser.cs @@ -9,7 +9,7 @@ using System.Diagnostics; using System.Linq; -namespace Lucene.Net.QueryParser.Simple +namespace Lucene.Net.QueryParsers.Simple { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs b/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs index bfb2fc230e..386c9ade1a 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs @@ -1,6 +1,6 @@ using System; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs b/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs index b33bd831c2..16a548e058 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs @@ -1,6 +1,6 @@ using System; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs index 1716658353..4b1e7f28dc 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs index 007ece113b..8ccb01ed1e 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs @@ -1,9 +1,9 @@ -using Lucene.Net.QueryParser.Surround.Query; +using Lucene.Net.QueryParsers.Surround.Query; using System; using System.Collections.Generic; using System.IO; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserConstants.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserConstants.cs index d02ab5d6b3..f5959c1dea 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserConstants.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserConstants.cs @@ -1,4 +1,4 @@ -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs index 3e7b281fdd..54dcfdde7c 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs @@ -2,7 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.IO; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/Token.cs b/src/Lucene.Net.QueryParser/Surround/Parser/Token.cs index 2d9b83d806..3b083d263b 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/Token.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/Token.cs @@ -1,6 +1,6 @@ using System; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs b/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs index 79120c7586..6d7f19fa41 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/TokenMgrError.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Parser +namespace Lucene.Net.QueryParsers.Surround.Parser { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/AndQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/AndQuery.cs index aa00e0ddee..bddaccaac5 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/AndQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/AndQuery.cs @@ -1,7 +1,7 @@ using Lucene.Net.Search; using System.Collections.Generic; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs b/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs index b0c6d36a12..523066d913 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/BasicQueryFactory.cs @@ -3,7 +3,7 @@ using Lucene.Net.Search.Spans; using System.Runtime.CompilerServices; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs index 05010fd6e7..aff2dee5a2 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/ComposedQuery.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs index 20ef47d832..0cf6fe1687 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs index 3d3a1087b2..d8884836e9 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceRewriteQuery.cs @@ -1,4 +1,4 @@ -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs index 639f9e0ea6..c7357eee01 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceSubQuery.cs @@ -1,4 +1,4 @@ -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/FieldsQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/FieldsQuery.cs index 228c7d68b5..df2c6e79dc 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/FieldsQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/FieldsQuery.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/NotQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/NotQuery.cs index 30d40a8b78..6ba5d2b576 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/NotQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/NotQuery.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/OrQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/OrQuery.cs index f7d0036c76..a48b8fd5d8 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/OrQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/OrQuery.cs @@ -1,7 +1,7 @@ using Lucene.Net.Search; using System.Collections.Generic; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs index a5795ee96f..fe41d5cf25 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs @@ -1,7 +1,7 @@ using Lucene.Net.Index; using System; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs index 77877bb064..a13c22e472 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs @@ -2,7 +2,7 @@ using System; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs index f2db8fbb10..1883994327 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTermRewriteQuery.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs b/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs index aa6a1d4d37..64ac626716 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SpanNearClauseFactory.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndBooleanQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndBooleanQuery.cs index fa61091177..9e38b9f7fc 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndBooleanQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndBooleanQuery.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs index 4044b097b9..6f850e0c33 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs @@ -2,7 +2,7 @@ using Lucene.Net.Util; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs index 569db53d79..93930c30af 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndQuery.cs @@ -3,7 +3,7 @@ using System; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndTermQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndTermQuery.cs index 45885a17fd..1d67cfa8be 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndTermQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndTermQuery.cs @@ -1,7 +1,7 @@ using Lucene.Net.Index; using Lucene.Net.Util; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs index 5ed9ff38e6..fc3e4e1c36 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs @@ -4,7 +4,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs b/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs index 27f313cc1d..e224d74395 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/TooManyBasicQueries.cs @@ -1,4 +1,4 @@ -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj b/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj index cba00d64b7..f6ccba0db8 100644 --- a/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj +++ b/src/Lucene.Net.Suggest/Lucene.Net.Suggest.csproj @@ -7,7 +7,7 @@ {FBD2EB4D-EAC9-409C-A23D-64D27DF23576} Library Properties - Lucene.Net.Search + Lucene.Net.Suggest Lucene.Net.Suggest v4.5.1 512 diff --git a/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs index 77c4f9f48f..2d4928786f 100644 --- a/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs @@ -7,13 +7,13 @@ using Lucene.Net.Analysis.Tokenattributes; using Lucene.Net.Documents; using Lucene.Net.Index; -using Lucene.Net.QueryParser.Classic; +using Lucene.Net.QueryParsers.Classic; using Lucene.Net.Search; using Lucene.Net.Store; using Lucene.Net.Util; using NUnit.Framework; -namespace Lucene.Net.QueryParser.Analyzing +namespace Lucene.Net.QueryParsers.Analyzing { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs index 350f18134c..5961e8f263 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs @@ -9,7 +9,7 @@ using Lucene.Net.Search; using Lucene.Net.Util; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { [TestFixture] public class TestMultiAnalyzer_ : BaseTokenStreamTestCase diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs index f233c02966..0ad59bcf9c 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.IO; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs index 3aaa9b2a09..e203ad1ee2 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiPhraseQueryParsing.cs @@ -5,7 +5,7 @@ using Lucene.Net.Util; using NUnit.Framework; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs index b5ce3a7f7e..734e1d802d 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs @@ -1,15 +1,15 @@ using Lucene.Net.Analysis; using Lucene.Net.Analysis.Tokenattributes; using Lucene.Net.Documents; -using Lucene.Net.QueryParser.Flexible.Standard; -using Lucene.Net.QueryParser.Util; +using Lucene.Net.QueryParsers.Flexible.Standard; +using Lucene.Net.QueryParsers.Util; using Lucene.Net.Search; using Lucene.Net.Support; using NUnit.Framework; using System; using System.Diagnostics; -namespace Lucene.Net.QueryParser.Classic +namespace Lucene.Net.QueryParsers.Classic { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs b/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs index 2c2d6e232a..e93e4a5c36 100644 --- a/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs +++ b/src/Lucene.Net.Tests.QueryParser/ComplexPhrase/TestComplexPhraseQuery.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Generic; -namespace Lucene.Net.QueryParser.ComplexPhrase +namespace Lucene.Net.QueryParsers.ComplexPhrase { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/ExtensionStub.cs b/src/Lucene.Net.Tests.QueryParser/Ext/ExtensionStub.cs index cbef5d844b..2b399f33f1 100644 --- a/src/Lucene.Net.Tests.QueryParser/Ext/ExtensionStub.cs +++ b/src/Lucene.Net.Tests.QueryParser/Ext/ExtensionStub.cs @@ -1,7 +1,7 @@ using Lucene.Net.Index; using Lucene.Net.Search; -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs index 7e2e99e5ed..b33689815c 100644 --- a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs @@ -1,10 +1,10 @@ using Lucene.Net.Analysis; -using Lucene.Net.QueryParser.Classic; +using Lucene.Net.QueryParsers.Classic; using Lucene.Net.Search; using NUnit.Framework; using System.Globalization; -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs index 4850987b3e..25a41acd8a 100644 --- a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs +++ b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs @@ -2,7 +2,7 @@ using NUnit.Framework; using System; -namespace Lucene.Net.QueryParser.Ext +namespace Lucene.Net.QueryParsers.Ext { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj b/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj index 326ad05d31..667a17081f 100644 --- a/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj +++ b/src/Lucene.Net.Tests.QueryParser/Lucene.Net.Tests.QueryParser.csproj @@ -7,7 +7,7 @@ {5719FB4F-BF80-40E5-BACC-37E8E18FCA2E} Library Properties - Lucene.Net.Tests.QueryParser + Lucene.Net.QueryParsers Lucene.Net.Tests.QueryParser v4.5.1 512 diff --git a/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs index 0a9d49fab7..751d2036f0 100644 --- a/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Text; -namespace Lucene.Net.QueryParser.Simple +namespace Lucene.Net.QueryParsers.Simple { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/BooleanQueryTst.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/BooleanQueryTst.cs index 6f7fcfcb68..b1041fc39c 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/BooleanQueryTst.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/BooleanQueryTst.cs @@ -3,7 +3,7 @@ using NUnit.Framework; using System; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/ExceptionQueryTst.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/ExceptionQueryTst.cs index 7468ef9c90..85f6b0615f 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/ExceptionQueryTst.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/ExceptionQueryTst.cs @@ -1,8 +1,8 @@ -using Lucene.Net.QueryParser.Surround.Parser; +using Lucene.Net.QueryParsers.Surround.Parser; using System; using System.Text; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs index 1221835105..64029c6c99 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs @@ -5,7 +5,7 @@ using Lucene.Net.Util; using System; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/SrndQueryTest.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/SrndQueryTest.cs index ebe7e2b450..44454578d0 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/SrndQueryTest.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/SrndQueryTest.cs @@ -2,7 +2,7 @@ using Lucene.Net.Util; using NUnit.Framework; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs index 6ebc87a35b..1be41604bc 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs @@ -1,7 +1,7 @@ using Lucene.Net.Util; using NUnit.Framework; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs index aef9279104..c0e5407710 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test02Boolean.cs @@ -2,7 +2,7 @@ using NUnit.Framework; using System; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs index 6a19cb76d9..12a4e76a8c 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test03Distance.cs @@ -2,7 +2,7 @@ using NUnit.Framework; using System; -namespace Lucene.Net.QueryParser.Surround.Query +namespace Lucene.Net.QueryParsers.Surround.Query { /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs b/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs index b879008bef..4fe01c5e32 100644 --- a/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs +++ b/src/Lucene.Net.Tests.QueryParser/Util/QueryParserTestBase.cs @@ -2,8 +2,8 @@ using Lucene.Net.Analysis.Tokenattributes; using Lucene.Net.Documents; using Lucene.Net.Index; -using Lucene.Net.QueryParser.Classic; -using Lucene.Net.QueryParser.Flexible.Standard; +using Lucene.Net.QueryParsers.Classic; +using Lucene.Net.QueryParsers.Flexible.Standard; using Lucene.Net.Search; using Lucene.Net.Store; using Lucene.Net.Support; @@ -18,7 +18,7 @@ using System.Text; using System.Threading.Tasks; -namespace Lucene.Net.QueryParser.Util +namespace Lucene.Net.QueryParsers.Util { /// /// In .NET the abstact members were moved to AbstractQueryParserTestBase From 95e2e5d2a79fa6bac29eefd54220a62701e528ab Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Mon, 19 Sep 2016 12:00:40 +0700 Subject: [PATCH 02/11] Fixed all compiler warnings in QueryParser --- .../Analyzing/AnalyzingQueryParser.cs | 2 +- .../Classic/QueryParserBase.cs | 12 ++++++++--- .../Surround/Parser/QueryParser.cs | 20 +++++++++---------- .../Parser/QueryParserTokenManager.cs | 8 ++++---- .../Analyzing/TestAnalyzingQueryParser.cs | 6 +++--- .../Classic/TestMultiAnalyzer.cs | 2 ++ .../Classic/TestMultiFieldQueryParser.cs | 10 +++++----- .../Classic/TestQueryParser.cs | 10 +++++----- .../Ext/TestExtendableQueryParser.cs | 2 +- .../Ext/TestExtensions.cs | 2 +- .../Surround/Query/SingleFieldTestDb.cs | 2 ++ .../Surround/Query/Test01Exceptions.cs | 2 +- 12 files changed, 44 insertions(+), 34 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs b/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs index 68a22e3b38..434f66800a 100644 --- a/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs @@ -183,7 +183,7 @@ protected internal virtual string AnalyzeSingleChunk(string field, string termSt throw new ParseException(string.Format(Locale, @"Analyzer returned nothing for ""{0}""", chunk)); } } - catch (System.IO.IOException e) + catch (System.IO.IOException /*e*/) { throw new ParseException( string.Format(Locale, @"IO error while trying to analyze single term: ""{0}""", termStr)); diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs index a6103f2922..68d1ef6ef3 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs @@ -123,7 +123,9 @@ protected QueryParserBase() AllowLeadingWildcard = false; PhraseSlop = 0; +#pragma warning disable 612, 618 FuzzyMinSim = FuzzyQuery.DefaultMinSimilarity; +#pragma warning restore 612, 618 FuzzyPrefixLength = FuzzyQuery.DefaultPrefixLength; Locale = CultureInfo.CurrentCulture; TimeZone = TimeZoneInfo.Local; @@ -141,7 +143,9 @@ public virtual void Init(LuceneVersion matchVersion, string f, Analyzer a) { Analyzer = a; field = f; +#pragma warning disable 612, 618 if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31)) +#pragma warning restore 612, 618 { AutoGeneratePhraseQueries = false; } @@ -542,8 +546,10 @@ protected internal virtual Query NewFuzzyQuery(Term term, float minimumSimilarit { // FuzzyQuery doesn't yet allow constant score rewrite string text = term.Text(); +#pragma warning disable 612, 618 int numEdits = FuzzyQuery.FloatToEdits(minimumSimilarity, Character.CodePointCount(text,0, text.Length)); +#pragma warning restore 612, 618 return new FuzzyQuery(term, numEdits, prefixLength); } @@ -837,7 +843,7 @@ internal virtual Query HandleBareFuzzy(string qfield, Token fuzzySlop, string te { fms = float.Parse(fuzzySlop.image.Substring(1), Locale); } - catch (Exception ignored) { } + catch (Exception /*ignored*/) { } if (fms < 0.0f) { throw new ParseException("Minimum similarity for a FuzzyQuery has to be between 0.0f and 1.0f !"); @@ -860,7 +866,7 @@ internal virtual Query HandleQuotedTerm(string qfield, Token term, Token fuzzySl { s = (int)float.Parse(fuzzySlop.image.Substring(1), Locale); } - catch (Exception ignored) { } + catch (Exception /*ignored*/) { } } return GetFieldQuery(qfield, DiscardEscapeChar(term.image.Substring(1, term.image.Length - 2)), s); } @@ -875,7 +881,7 @@ internal virtual Query HandleBoost(Query q, Token boost) { f = float.Parse(boost.image, Locale); } - catch (Exception ignored) + catch (Exception /*ignored*/) { /* Should this be handled somehow? (defaults to "no boost", if * boost number is invalid) diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs index 8ccb01ed1e..afdfc64a92 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs @@ -432,25 +432,25 @@ public SrndQuery PrefixOperatorQuery() /* prefix OR */ queries = FieldsQueryList(); { if (true) return GetOrQuery(queries, false /* not infix */, oprt); } - break; + //break; // unreachable case RegexpToken.AND: oprt = Jj_consume_token(RegexpToken.AND); /* prefix AND */ queries = FieldsQueryList(); { if (true) return GetAndQuery(queries, false /* not infix */, oprt); } - break; + //break; // unreachable case RegexpToken.N: oprt = Jj_consume_token(RegexpToken.N); /* prefix N */ queries = FieldsQueryList(); { if (true) return GetDistanceQuery(queries, false /* not infix */, oprt, false /* not ordered */); } - break; + //break; // unreachable case RegexpToken.W: oprt = Jj_consume_token(RegexpToken.W); /* prefix W */ queries = FieldsQueryList(); { if (true) return GetDistanceQuery(queries, false /* not infix */, oprt, true /* ordered */); } - break; + //break; // unreachable default: jj_la1[6] = jj_gen; Jj_consume_token(-1); @@ -496,11 +496,11 @@ public SrndQuery SimpleTerm() case RegexpToken.TERM: term = Jj_consume_token(RegexpToken.TERM); { if (true) return GetTermQuery(term.image, false /* not quoted */); } - break; + //break; // unreachable case RegexpToken.QUOTED: term = Jj_consume_token(RegexpToken.QUOTED); { if (true) return GetTermQuery(term.image.Substring(1, (term.image.Length - 1) - 1), true /* quoted */); } - break; + //break; // unreachable case RegexpToken.SUFFIXTERM: term = Jj_consume_token(RegexpToken.SUFFIXTERM); /* ending in * */ @@ -509,7 +509,7 @@ public SrndQuery SimpleTerm() { if (true) throw new ParseException(truncationErrorMessage + term.image); } } { if (true) return GetPrefixQuery(term.image.Substring(0, term.image.Length - 1), false /* not quoted */); } - break; + //break; // unreachable case RegexpToken.TRUNCTERM: term = Jj_consume_token(RegexpToken.TRUNCTERM); /* with at least one * or ? */ @@ -518,7 +518,7 @@ public SrndQuery SimpleTerm() { if (true) throw new ParseException(truncationErrorMessage + term.image); } } { if (true) return GetTruncQuery(term.image); } - break; + //break; // unreachable case RegexpToken.TRUNCQUOTED: term = Jj_consume_token(RegexpToken.TRUNCQUOTED); /* eg. "9b-b,m"* */ @@ -527,7 +527,7 @@ public SrndQuery SimpleTerm() { if (true) throw new ParseException(truncationErrorMessage + term.image); } } { if (true) return GetPrefixQuery(term.image.Substring(1, (term.image.Length - 2) - 1), true /* quoted */); } - break; + //break; // unreachable default: jj_la1[8] = jj_gen; Jj_consume_token(-1); @@ -883,7 +883,7 @@ private void Jj_rescan_token() p = p.next; } while (p != null); } - catch (LookaheadSuccess ls) { } + catch (LookaheadSuccess /*ls*/) { } } jj_rescan = false; } diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs index 54dcfdde7c..01fd465ae1 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs @@ -433,7 +433,7 @@ private int JjMoveNfa_1(int startState, int curPos) if ((i = jjnewStateCnt) == (startsAt = 38 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.ReadChar(); } - catch (System.IO.IOException e) { return curPos; } + catch (System.IO.IOException /*e*/) { return curPos; } } } @@ -520,7 +520,7 @@ private int JjMoveNfa_0(int startState, int curPos) if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.ReadChar(); } - catch (System.IO.IOException e) { return curPos; } + catch (System.IO.IOException /*e*/) { return curPos; } } } internal static readonly int[] jjnextStates = { @@ -662,7 +662,7 @@ public virtual Token GetNextToken() { curChar = input_stream.BeginToken(); } - catch (System.IO.IOException e) + catch (System.IO.IOException /*e*/) { jjmatchedKind = 0; matchedToken = JjFillToken(); @@ -705,7 +705,7 @@ public virtual Token GetNextToken() string error_after = null; bool EOFSeen = false; try { input_stream.ReadChar(); input_stream.Backup(1); } - catch (System.IO.IOException e1) + catch (System.IO.IOException /*e1*/) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.Image; diff --git a/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs index 2d4928786f..84240896f4 100644 --- a/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Analyzing/TestAnalyzingQueryParser.cs @@ -137,7 +137,7 @@ public void TestWildcardAlone() { Query q = GetAnalyzedQuery("*", a, false); } - catch (ParseException e) + catch (ParseException /*e*/) { pex = true; } @@ -149,7 +149,7 @@ public void TestWildcardAlone() String qString = ParseWithAnalyzingQueryParser("*", a, true); assertEquals("Every word", "*", qString); } - catch (ParseException e) + catch (ParseException /*e*/) { pex = true; } @@ -181,7 +181,7 @@ public void TestWildCardQueryNoLeadingAllowed() string q = ParseWithAnalyzingQueryParser(wildcardInput[0], a, false); } - catch (ParseException e) + catch (ParseException /*e*/) { ex = true; } diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs index 5961e8f263..b98ba83f16 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiAnalyzer.cs @@ -98,7 +98,9 @@ public void TestMultiAnalyzerWithSubclassOfQueryParser() [Test] public void TestPosIncrementAnalyzer() { +#pragma warning disable 612, 618 QueryParser qp = new QueryParser(LuceneVersion.LUCENE_40, "", new PosIncrementAnalyzer()); +#pragma warning restore 612, 618 assertEquals("quick brown", qp.Parse("the quick brown").toString()); assertEquals("quick brown fox", qp.Parse("the quick brown fox").toString()); } diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs index 0ad59bcf9c..9e90937697 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestMultiFieldQueryParser.cs @@ -182,7 +182,7 @@ public void TestStaticMethod1() q = MultiFieldQueryParser.Parse(TEST_VERSION_CURRENT, queries5, fields, new MockAnalyzer(Random())); fail(); } - catch (ArgumentException e) + catch (ArgumentException /*e*/) { // expected exception, array length differs } @@ -216,7 +216,7 @@ public void TestStaticMethod2() q = MultiFieldQueryParser.Parse(TEST_VERSION_CURRENT, "blah", fields, flags2, new MockAnalyzer(Random())); fail(); } - catch (ArgumentException e) + catch (ArgumentException /*e*/) { // expected exception, array length differs } @@ -241,7 +241,7 @@ public void TestStaticMethod2Old() q = MultiFieldQueryParser.Parse(TEST_VERSION_CURRENT, "blah", fields, flags2, new MockAnalyzer(Random())); fail(); } - catch (ArgumentException e) + catch (ArgumentException /*e*/) { // expected exception, array length differs } @@ -263,7 +263,7 @@ public void TestStaticMethod3() q = MultiFieldQueryParser.Parse(TEST_VERSION_CURRENT, queries, fields, flags2, new MockAnalyzer(Random())); fail(); } - catch (ArgumentException e) + catch (ArgumentException /*e*/) { // expected exception, array length differs } @@ -284,7 +284,7 @@ public void TestStaticMethod3Old() q = MultiFieldQueryParser.Parse(TEST_VERSION_CURRENT, queries, fields, flags2, new MockAnalyzer(Random())); fail(); } - catch (ArgumentException e) + catch (ArgumentException /*e*/) { // expected exception, array length differs } diff --git a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs index 734e1d802d..fd3f23e319 100644 --- a/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs @@ -156,7 +156,7 @@ public void TestProtectedCtors() typeof(QueryParser).GetConstructor(new Type[] { typeof(ICharStream) }); fail("please switch public QueryParser(CharStream) to be protected"); } - catch (Exception nsme) + catch (Exception /*nsme*/) { // expected } @@ -165,7 +165,7 @@ public void TestProtectedCtors() typeof(QueryParser).GetConstructor(new Type[] { typeof(QueryParserTokenManager) }); fail("please switch public QueryParser(QueryParserTokenManager) to be protected"); } - catch (Exception nsme) + catch (Exception /*nsme*/) { // expected } @@ -186,7 +186,7 @@ internal override Query HandleBareFuzzy(string qfield, Token fuzzySlop, string t { fms = float.Parse(fuzzySlop.image.Substring(1, fuzzySlop.image.Length - 2)); } - catch (Exception ignored) { } + catch (Exception /*ignored*/) { } float value = float.Parse(termImage); return GetRangeQuery(qfield, (value - fms / 2.0f).ToString(), (value + fms / 2.0f).ToString(), true, true); } @@ -281,7 +281,7 @@ public void TestCustomQueryParserWildcard() MockTokenizer.WHITESPACE, false)).Parse("a?t"); fail("Wildcard queries should not be allowed"); } - catch (ParseException expected) + catch (ParseException /*expected*/) { // expected exception } @@ -296,7 +296,7 @@ public void TestCustomQueryParserFuzzy() MockTokenizer.WHITESPACE, false)).Parse("xunit~"); fail("Fuzzy queries should not be allowed"); } - catch (ParseException expected) + catch (ParseException /*expected*/) { // expected exception } diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs index b33689815c..9ce7e01d83 100644 --- a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtendableQueryParser.cs @@ -59,7 +59,7 @@ public void TestUnescapedExtDelimiter() parser.Parse("aField:testExt:\"foo \\& bar\""); fail("extension field delimiter is not escaped"); } - catch (ParseException e) + catch (ParseException /*e*/) { } } diff --git a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs index 25a41acd8a..ffb6f07c43 100644 --- a/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs +++ b/src/Lucene.Net.Tests.QueryParser/Ext/TestExtensions.cs @@ -88,7 +88,7 @@ public void TestEscapeExtension() fail("should throw NPE - escape string is null"); } //catch (NullPointerException e) - catch (Exception e) + catch (Exception /*e*/) { // } diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs index 64029c6c99..7103bc9110 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/SingleFieldTestDb.cs @@ -36,7 +36,9 @@ public SingleFieldTestDb(Random random, string[] documents, string fName) docs = documents; fieldName = fName; using (IndexWriter writer = new IndexWriter(db, new IndexWriterConfig( +#pragma warning disable 612, 618 LuceneVersion.LUCENE_CURRENT, +#pragma warning restore 612, 618 new MockAnalyzer(random)))) { for (int j = 0; j < docs.Length; j++) diff --git a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs index 1be41604bc..14b38c06cc 100644 --- a/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs +++ b/src/Lucene.Net.Tests.QueryParser/Surround/Query/Test01Exceptions.cs @@ -30,7 +30,7 @@ public class Test01Exceptions_ : LuceneTestCase //} private bool verbose = false; /* to show actual parsing error messages */ - private readonly string fieldName = "bi"; + //private readonly string fieldName = "bi"; string[] exceptionQueries = { "*", From d4b005cd4269f95e47f6a63237c0f0ee77af9e78 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 12:25:22 +0700 Subject: [PATCH 03/11] Fixed string comparison bug in QueryParser.Surround.Query.SimpleTerm --- src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs index a13c22e472..ece27fecd4 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SimpleTerm.cs @@ -1,4 +1,5 @@ using Lucene.Net.Index; +using Lucene.Net.Support; using System; using System.Text; @@ -43,7 +44,7 @@ public SimpleTerm(bool q) public int CompareTo(SimpleTerm ost) { /* for ordering terms and prefixes before using an index, not used */ - return this.ToStringUnquoted().CompareTo(ost.ToStringUnquoted()); + return this.ToStringUnquoted().CompareToOrdinal(ost.ToStringUnquoted()); } protected virtual void SuffixToString(StringBuilder r) { } /* override for prefix query */ From 5daf702008a30c1ace762c67f25db98e2249b612 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 12:28:40 +0700 Subject: [PATCH 04/11] Fixed bug in QueryParser.Surround.Parser.QueryParserTokenManager that caused all of the Surround QueryParser tests to fail. --- .../Surround/Parser/QueryParserTokenManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs index 01fd465ae1..84f7250eda 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParserTokenManager.cs @@ -686,7 +686,7 @@ public virtual Token GetNextToken() { if (jjmatchedPos + 1 < curPos) input_stream.Backup(curPos - jjmatchedPos - 1); - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 63 /*077*/))) != 0L) { matchedToken = JjFillToken(); if (jjnewLexState[jjmatchedKind] != -1) From 834d91e7b8e0aa7ff169c1d44c2b9a3eec14f23e Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 12:31:16 +0700 Subject: [PATCH 05/11] Fixed bug in the Core.Search.Query class. We cannot set the Boost property in the constructor, since subclasses can override it and throw exceptions. --- src/Lucene.Net.Core/Search/Query.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Lucene.Net.Core/Search/Query.cs b/src/Lucene.Net.Core/Search/Query.cs index affbdc5f84..c765dab744 100644 --- a/src/Lucene.Net.Core/Search/Query.cs +++ b/src/Lucene.Net.Core/Search/Query.cs @@ -48,17 +48,21 @@ namespace Lucene.Net.Search /// public abstract class Query : ICloneable { - protected Query() - { - Boost = 1.0f; // query boost factor - } + // LUCENENET NOTE: We can't set the default boost in the constructor because the + // Boost property can be overridden by subclasses (and possibly throw exceptions). + private float boost = 1.0f; // query boost factor + /// /// Sets the boost for this query clause to b. Documents /// matching this clause will (in addition to the normal weightings) have /// their score multiplied by b. /// - public virtual float Boost { get; set; } + public virtual float Boost + { + get { return boost; } + set { boost = value; } + } /// /// Prints a query to a string, with field assumed to be the From f4f94534d902fa8a5ec67b9acc34a6446838f5ce Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 12:38:28 +0700 Subject: [PATCH 06/11] Fixed bug in QueryParser.Surround.Query.DistanceQuery.DistanceSubQueryNotAllowed() that was causing a null reference exception when the type of query does not implement IDistanceSubQuery. --- src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs index 0cf6fe1687..7e4217df99 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs @@ -51,9 +51,10 @@ public virtual string DistanceSubQueryNotAllowed() var sqi = GetSubQueriesEnumerator(); while (sqi.MoveNext()) { - var dsq = sqi.Current as IDistanceSubQuery; - if (dsq != null) + var leq = sqi.Current; + if (leq is IDistanceSubQuery) { + var dsq = sqi.Current as IDistanceSubQuery; string m = dsq.DistanceSubQueryNotAllowed(); if (m != null) { @@ -62,7 +63,7 @@ public virtual string DistanceSubQueryNotAllowed() } else { - return "Operator " + OperatorName + " does not allow subquery " + dsq.ToString(); + return "Operator " + OperatorName + " does not allow subquery " + leq.ToString(); } } return null; /* subqueries acceptable */ From 1757a607b180dd9ebda03ca4261b5939e2fa7d19 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 14:36:21 +0700 Subject: [PATCH 07/11] Fixed bugs in the QueryParser.Simple.TestSimpleQueryParser tests that were inverting the logic and testing for enabled rather than disabled option states. --- .../Simple/TestSimpleQueryParser.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs index 751d2036f0..f05b46789d 100644 --- a/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs +++ b/src/Lucene.Net.Tests.QueryParser/Simple/TestSimpleQueryParser.cs @@ -605,7 +605,7 @@ private Query ParseKeyword(string text, int flags) public void TestDisablePhrase() { Query expected = new TermQuery(new Term("field", "\"test\"")); - assertEquals(expected, ParseKeyword("\"test\"", SimpleQueryParser.PHRASE_OPERATOR)); + assertEquals(expected, ParseKeyword("\"test\"", ~SimpleQueryParser.PHRASE_OPERATOR)); } /** test the ability to enable/disable prefix operator */ @@ -613,7 +613,7 @@ public void TestDisablePhrase() public void TestDisablePrefix() { Query expected = new TermQuery(new Term("field", "test*")); - assertEquals(expected, ParseKeyword("test*", SimpleQueryParser.PREFIX_OPERATOR)); + assertEquals(expected, ParseKeyword("test*", ~SimpleQueryParser.PREFIX_OPERATOR)); } /** test the ability to enable/disable AND operator */ @@ -621,9 +621,9 @@ public void TestDisablePrefix() public void TestDisableAND() { Query expected = new TermQuery(new Term("field", "foo+bar")); - assertEquals(expected, ParseKeyword("foo+bar", SimpleQueryParser.AND_OPERATOR)); + assertEquals(expected, ParseKeyword("foo+bar", ~SimpleQueryParser.AND_OPERATOR)); expected = new TermQuery(new Term("field", "+foo+bar")); - assertEquals(expected, ParseKeyword("+foo+bar", SimpleQueryParser.AND_OPERATOR)); + assertEquals(expected, ParseKeyword("+foo+bar", ~SimpleQueryParser.AND_OPERATOR)); } /** test the ability to enable/disable OR operator */ @@ -631,9 +631,9 @@ public void TestDisableAND() public void TestDisableOR() { Query expected = new TermQuery(new Term("field", "foo|bar")); - assertEquals(expected, ParseKeyword("foo|bar", SimpleQueryParser.OR_OPERATOR)); + assertEquals(expected, ParseKeyword("foo|bar", ~SimpleQueryParser.OR_OPERATOR)); expected = new TermQuery(new Term("field", "|foo|bar")); - assertEquals(expected, ParseKeyword("|foo|bar", SimpleQueryParser.OR_OPERATOR)); + assertEquals(expected, ParseKeyword("|foo|bar", ~SimpleQueryParser.OR_OPERATOR)); } /** test the ability to enable/disable NOT operator */ @@ -641,7 +641,7 @@ public void TestDisableOR() public void TestDisableNOT() { Query expected = new TermQuery(new Term("field", "-foo")); - assertEquals(expected, ParseKeyword("-foo", SimpleQueryParser.NOT_OPERATOR)); + assertEquals(expected, ParseKeyword("-foo", ~SimpleQueryParser.NOT_OPERATOR)); } /** test the ability to enable/disable precedence operators */ @@ -649,9 +649,9 @@ public void TestDisableNOT() public void TestDisablePrecedence() { Query expected = new TermQuery(new Term("field", "(foo)")); - assertEquals(expected, ParseKeyword("(foo)", SimpleQueryParser.PRECEDENCE_OPERATORS)); + assertEquals(expected, ParseKeyword("(foo)", ~SimpleQueryParser.PRECEDENCE_OPERATORS)); expected = new TermQuery(new Term("field", ")foo(")); - assertEquals(expected, ParseKeyword(")foo(", SimpleQueryParser.PRECEDENCE_OPERATORS)); + assertEquals(expected, ParseKeyword(")foo(", ~SimpleQueryParser.PRECEDENCE_OPERATORS)); } /** test the ability to enable/disable escape operators */ @@ -659,27 +659,27 @@ public void TestDisablePrecedence() public void TestDisableEscape() { Query expected = new TermQuery(new Term("field", "foo\\bar")); - assertEquals(expected, ParseKeyword("foo\\bar", SimpleQueryParser.ESCAPE_OPERATOR)); - assertEquals(expected, ParseKeyword("(foo\\bar)", SimpleQueryParser.ESCAPE_OPERATOR)); - assertEquals(expected, ParseKeyword("\"foo\\bar\"", SimpleQueryParser.ESCAPE_OPERATOR)); + assertEquals(expected, ParseKeyword("foo\\bar", ~SimpleQueryParser.ESCAPE_OPERATOR)); + assertEquals(expected, ParseKeyword("(foo\\bar)", ~SimpleQueryParser.ESCAPE_OPERATOR)); + assertEquals(expected, ParseKeyword("\"foo\\bar\"", ~SimpleQueryParser.ESCAPE_OPERATOR)); } [Test] public void TestDisableWhitespace() { Query expected = new TermQuery(new Term("field", "foo foo")); - assertEquals(expected, ParseKeyword("foo foo", SimpleQueryParser.WHITESPACE_OPERATOR)); + assertEquals(expected, ParseKeyword("foo foo", ~SimpleQueryParser.WHITESPACE_OPERATOR)); expected = new TermQuery(new Term("field", " foo foo\n ")); - assertEquals(expected, ParseKeyword(" foo foo\n ", SimpleQueryParser.WHITESPACE_OPERATOR)); + assertEquals(expected, ParseKeyword(" foo foo\n ", ~SimpleQueryParser.WHITESPACE_OPERATOR)); expected = new TermQuery(new Term("field", "\t\tfoo foo foo")); - assertEquals(expected, ParseKeyword("\t\tfoo foo foo", SimpleQueryParser.WHITESPACE_OPERATOR)); + assertEquals(expected, ParseKeyword("\t\tfoo foo foo", ~SimpleQueryParser.WHITESPACE_OPERATOR)); } [Test] public void TestDisableFuzziness() { Query expected = new TermQuery(new Term("field", "foo~1")); - assertEquals(expected, ParseKeyword("foo~1", SimpleQueryParser.FUZZY_OPERATOR)); + assertEquals(expected, ParseKeyword("foo~1", ~SimpleQueryParser.FUZZY_OPERATOR)); } [Test] @@ -692,7 +692,7 @@ public void TestDisableSlop() BooleanQuery expected = new BooleanQuery(); expected.Add(expectedPhrase, BooleanClause.Occur.MUST); expected.Add(new TermQuery(new Term("field", "~2")), BooleanClause.Occur.MUST); - assertEquals(expected, Parse("\"foo bar\"~2", SimpleQueryParser.NEAR_OPERATOR)); + assertEquals(expected, Parse("\"foo bar\"~2", ~SimpleQueryParser.NEAR_OPERATOR)); } // we aren't supposed to barf on any input... From dee8fb41c8149a73ef090b6ce902eda27c9ba9fc Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 14:38:11 +0700 Subject: [PATCH 08/11] Finished implementation of QueryParser.Surround.Query.SrndTruncQuery --- .../Surround/Query/SrndTruncQuery.cs | 89 +++++++++---------- 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs index fc3e4e1c36..2925ce9594 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs @@ -83,57 +83,52 @@ protected virtual void TruncatedToPrefixAndPattern() pattern = new Regex(re.ToString(), RegexOptions.Compiled); } - // TODO: Finish implementation public override void VisitMatchingTerms(IndexReader reader, string fieldName, SimpleTerm.IMatchingTermVisitor mtv) { - throw new NotImplementedException("Need to translate this from Java's whacky RegEx syntax"); - //int prefixLength = prefix.Length; - //Terms terms = MultiFields.GetTerms(reader, fieldName); - //if (terms != null) - //{ - // MatchCollection matcher = pattern.Matches(""); - // try - // { - // TermsEnum termsEnum = terms.Iterator(null); + int prefixLength = prefix.Length; + Terms terms = MultiFields.GetTerms(reader, fieldName); + if (terms != null) + { + TermsEnum termsEnum = terms.Iterator(null); - // TermsEnum.SeekStatus status = termsEnum.SeekCeil(prefixRef); - // BytesRef text; - // if (status == TermsEnum.SeekStatus.FOUND) - // { - // text = prefixRef; - // } - // else if (status == TermsEnum.SeekStatus.NOT_FOUND) - // { - // text = termsEnum.Term(); - // } - // else - // { - // text = null; - // } + TermsEnum.SeekStatus status = termsEnum.SeekCeil(prefixRef); + BytesRef text; + if (status == TermsEnum.SeekStatus.FOUND) + { + text = prefixRef; + } + else if (status == TermsEnum.SeekStatus.NOT_FOUND) + { + text = termsEnum.Term(); + } + else + { + text = null; + } - // while (text != null) - // { - // if (text != null && StringHelper.StartsWith(text, prefixRef)) - // { - // string textString = text.Utf8ToString(); - // matcher.Reset(textString.Substring(prefixLength)); - // if (matcher.Success) - // { - // mtv.VisitMatchingTerm(new Term(fieldName, textString)); - // } - // } - // else - // { - // break; - // } - // text = termsEnum.Next(); - // } - // } - // finally - // { - // matcher.Reset(); - // } - //} + while (text != null) + { + if (text != null && StringHelper.StartsWith(text, prefixRef)) + { + string textString = text.Utf8ToString(); + // LUCENENET NOTE: Java's matches() method checks to see if the + // entire string is a match with the regex, so we mimic that + // by testing to ensure the lengths of the input and match are equal + // as well as whether it is successful. + string toMatchEntirely = textString.Substring(prefixLength); + Match matcher = pattern.Match(toMatchEntirely); + if (matcher.Success && matcher.Length == toMatchEntirely.Length) + { + mtv.VisitMatchingTerm(new Term(fieldName, textString)); + } + } + else + { + break; + } + text = termsEnum.Next(); + } + } } } } From 97bd5828a386bbe90e3ccc301fa4ec68bc2e0ae6 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 15:46:44 +0700 Subject: [PATCH 09/11] Added missing QueryParser.Analyzing.AnalyzingQueryParser.GetPrefixQuery override that was causing the TestAnalyzingQueryParser.TestPrefixQuery() test to fail. --- .../Analyzing/AnalyzingQueryParser.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs b/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs index 434f66800a..34c50dbd11 100644 --- a/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Analyzing/AnalyzingQueryParser.cs @@ -109,6 +109,27 @@ protected internal override Query GetWildcardQuery(string field, string termStr) return base.GetWildcardQuery(field, sb.ToString()); } + /// + /// Called when parser parses an input term + /// that uses prefix notation; that is, contains a single '*' wildcard + /// character as its last character.Since this is a special case + /// of generic wildcard term, and such a query can be optimized easily, + /// this usually results in a different query object. + ///

+ /// Depending on analyzer and settings, a prefix term may (most probably will) + /// be lower-cased automatically. It will go through the default Analyzer. + ///

+ /// Overrides super class, by passing terms through analyzer. + ///

+ /// Name of the field query will use. + /// Term to use for building term for the query (without trailing '*' character!) + /// Resulting built for the term + protected internal override Query GetPrefixQuery(string field, string termStr) + { + string analyzed = AnalyzeSingleChunk(field, termStr, termStr); + return base.GetPrefixQuery(field, analyzed); + } + /// /// Called when parser parses an input term that has the fuzzy suffix (~) appended. ///

From 195bbfc754731075f2ecb7fee325dba9bab09152 Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 22 Sep 2016 15:47:46 +0700 Subject: [PATCH 10/11] Changed all "String" references to "string" in QueryParser --- .../Classic/CharStream.cs | 4 ++-- .../Classic/FastCharStream.cs | 2 +- .../Classic/MultiFieldQueryParser.cs | 12 ++++++------ .../Classic/ParseException.cs | 2 +- .../Classic/QueryParser.cs | 6 +++--- .../Classic/QueryParserBase.cs | 8 ++++---- .../Classic/QueryParserTokenManager.cs | 6 +++--- .../Ext/ExtendableQueryParser.cs | 2 +- src/Lucene.Net.QueryParser/Ext/Extensions.cs | 18 +++++++++--------- .../Surround/Parser/CharStream.cs | 4 ++-- .../Surround/Parser/FastCharStream.cs | 2 +- .../Surround/Parser/ParseException.cs | 2 +- .../Surround/Parser/QueryParser.cs | 4 ++-- .../Surround/Query/DistanceQuery.cs | 2 +- .../Surround/Query/RewriteQuery.cs | 2 +- .../Surround/Query/SrndPrefixQuery.cs | 2 +- 16 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Classic/CharStream.cs b/src/Lucene.Net.QueryParser/Classic/CharStream.cs index 32294a8b79..7da1942b17 100644 --- a/src/Lucene.Net.QueryParser/Classic/CharStream.cs +++ b/src/Lucene.Net.QueryParser/Classic/CharStream.cs @@ -30,7 +30,7 @@ namespace Lucene.Net.QueryParsers.Classic /// All the methods except backup can be implemented in any fashion. backup /// needs to be implemented correctly for the correct operation of the lexer. /// Rest of the methods are all used to get information like line number, - /// column number and the String that constitutes a token and are not used + /// column number and the string that constitutes a token and are not used /// by the lexer. Hence their implementation won't affect the generated lexer's /// operation. ///

@@ -117,7 +117,7 @@ public interface ICharStream /// implementation of this is as follows : /// /// { - /// String t = GetImage(); + /// string t = GetImage(); /// return t.substring(t.length() - len, t.length()).toCharArray(); /// } ///
diff --git a/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs b/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs index c8c320461c..954e4251be 100644 --- a/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs +++ b/src/Lucene.Net.QueryParser/Classic/FastCharStream.cs @@ -103,7 +103,7 @@ public void Backup(int amount) public string Image { - get { return new System.String(buffer, tokenStart, bufferPosition - tokenStart); } + get { return new string(buffer, tokenStart, bufferPosition - tokenStart); } } public char[] GetSuffix(int len) diff --git a/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs b/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs index befda3185d..291f44c5e3 100644 --- a/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs @@ -36,7 +36,7 @@ public class MultiFieldQueryParser : QueryParser /// Boost, and the boost to apply to each term. /// ///

- /// It will, when parse(String query) is called, construct a query like this + /// It will, when parse(string query) is called, construct a query like this /// (assuming the query consists of two terms and you specify the two fields /// title and body): ///

@@ -76,7 +76,7 @@ public MultiFieldQueryParser(LuceneVersion matchVersion, string[] fields, Analyz /// Creates a MultiFieldQueryParser. /// ///

- /// It will, when parse(String query) is called, construct a query like this + /// It will, when parse(string query) is called, construct a query like this /// (assuming the query consists of two terms and you specify the two fields /// title and body): ///

@@ -189,7 +189,7 @@ protected internal override Query GetFuzzyQuery(string field, string termStr, fl return base.GetFuzzyQuery(field, termStr, minSimilarity); } - protected internal override Query GetPrefixQuery(System.String field, System.String termStr) + protected internal override Query GetPrefixQuery(string field, string termStr) { if (field == null) { @@ -296,7 +296,7 @@ public static Query Parse(LuceneVersion matchVersion, string[] queries, string[] ///

/// Uasge: /// - /// String[] fields = {"filename", "contents", "description"}; + /// string[] fields = {"filename", "contents", "description"}; /// BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, /// BooleanClause.Occur.MUST, /// BooleanClause.Occur.MUST_NOT}; @@ -351,8 +351,8 @@ public static Query Parse(LuceneVersion matchVersion, string query, string[] fie ///

/// Usage: /// - /// String[] query = {"query1", "query2", "query3"}; - /// String[] fields = {"filename", "contents", "description"}; + /// string[] query = {"query1", "query2", "query3"}; + /// string[] fields = {"filename", "contents", "description"}; /// BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, /// BooleanClause.Occur.MUST, /// BooleanClause.Occur.MUST_NOT}; diff --git a/src/Lucene.Net.QueryParser/Classic/ParseException.cs b/src/Lucene.Net.QueryParser/Classic/ParseException.cs index 835c4f47ba..efd8c3fe78 100644 --- a/src/Lucene.Net.QueryParser/Classic/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Classic/ParseException.cs @@ -217,7 +217,7 @@ internal static string Add_escapes(string str) default: if ((ch = str[i]) < 0x20 || ch > 0x7e) { - System.String s = "0000" + System.Convert.ToString(ch, 16); + string s = "0000" + System.Convert.ToString(ch, 16); retval.Append("\\u" + s.Substring(s.Length - 4, (s.Length) - (s.Length - 4))); } else diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs index 64878e94a5..97815160f3 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParser.cs @@ -25,7 +25,7 @@ namespace Lucene.Net.QueryParsers.Classic */ ///

This class is generated by JavaCC. The most important method is - /// . + /// . /// /// The syntax for query strings is as follows: /// A Query is a series of clauses. @@ -67,7 +67,7 @@ namespace Lucene.Net.QueryParsers.Classic ///

/// The date resolution that shall be used for RangeQueries can be set /// using - /// or . The former + /// or . The former /// sets the default date resolution for all fields, whereas the latter can /// be used to set field specific date resolutions. Field specific date /// resolutions take, if set, precedence over the default date resolution. @@ -75,7 +75,7 @@ namespace Lucene.Net.QueryParsers.Classic ///

/// If you don't use in your index, you can create your own /// query parser that inherits QueryParser and overwrites - /// to + /// to /// use a different method for date conversion. ///

/// diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs index 68d1ef6ef3..83e13a261d 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs @@ -424,7 +424,7 @@ protected internal virtual Query NewFieldQuery(Analyzer analyzer, string field, /// /// throw in overridden method to disallow /// - protected internal virtual Query GetFieldQuery(String field, String queryText, int slop) + protected internal virtual Query GetFieldQuery(string field, string queryText, int slop) { Query query = GetFieldQuery(field, queryText, true); @@ -898,7 +898,7 @@ internal virtual Query HandleBoost(Query q, Token boost) } ///

- /// Returns a String where the escape char has been + /// Returns a string where the escape char has been /// removed, or kept only once if there was a double escape. /// /// Supports escaped unicode characters, e. g. translates @@ -979,7 +979,7 @@ internal virtual string DiscardEscapeChar(string input) throw new ParseException("Term can not end with escape character."); } - return new String(output, 0, length); + return new string(output, 0, length); } /// @@ -1006,7 +1006,7 @@ private static int HexToInt(char c) } /// - /// Returns a String where those characters that QueryParser + /// Returns a string where those characters that QueryParser /// expects to be escaped are escaped by a preceding \. /// public static string Escape(string s) diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs index 409a33e745..cc5191f35d 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs @@ -1204,12 +1204,12 @@ public virtual void SwitchTo(int lexState) protected internal virtual Token JjFillToken() { Token t; - System.String curTokenImage; + string curTokenImage; int beginLine; int endLine; int beginColumn; int endColumn; - System.String im = jjstrLiteralImages[jjmatchedKind]; + string im = jjstrLiteralImages[jjmatchedKind]; curTokenImage = (im == null)?input_stream.Image:im; beginLine = input_stream.BeginLine; beginColumn = input_stream.BeginColumn; @@ -1293,7 +1293,7 @@ public virtual Token GetNextToken() } int error_line = input_stream.EndLine; int error_column = input_stream.EndColumn; - System.String error_after = null; + string error_after = null; bool EOFSeen = false; try { diff --git a/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs b/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs index b33ce13147..08538a23f1 100644 --- a/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Ext/ExtendableQueryParser.cs @@ -30,7 +30,7 @@ namespace Lucene.Net.QueryParsers.Ext /// keys into the field symbol associated with a registered instance of /// . A customizable separation character separates the /// extension key from the actual field symbol. The - /// splits () the + /// splits () the /// extension key from the field symbol and tries to resolve the associated /// . If the parser can't resolve the key or the field /// token does not contain a separation character, diff --git a/src/Lucene.Net.QueryParser/Ext/Extensions.cs b/src/Lucene.Net.QueryParser/Ext/Extensions.cs index f441850e9f..e64c80935d 100644 --- a/src/Lucene.Net.QueryParser/Ext/Extensions.cs +++ b/src/Lucene.Net.QueryParser/Ext/Extensions.cs @@ -83,7 +83,7 @@ public virtual char ExtensionFieldDelimiter /// /// Splits a extension field and returns the field / extension part as a - /// . This method tries to split on the first occurrence of the + /// . This method tries to split on the first occurrence of the /// extension field delimiter, if the delimiter is not present in the string /// the result will contain a null value for the extension key and /// the given field string as the field value. If the given extension field @@ -92,8 +92,8 @@ public virtual char ExtensionFieldDelimiter /// /// the default query field /// the extension field string - /// a { with the field name as the and the - /// extension key as the + /// a { with the field name as the and the + /// extension key as the public virtual Tuple SplitExtensionField(string defaultField, string field) { int indexOf = field.IndexOf(this.extensionFieldDelimiter); @@ -106,7 +106,7 @@ public virtual Tuple SplitExtensionField(string defaultField, st /// /// Escapes an extension field. The default implementation is equivalent to - /// . + /// . /// /// the extension field identifier /// the extension field identifier with all special chars escaped with @@ -125,8 +125,8 @@ public virtual string EscapeExtensionField(string extfield) /// beginning. Special Query characters are escaped in the result. ///

/// Note: subclasses must maintain the contract between - /// and - /// where the latter inverts the + /// and + /// where the latter inverts the /// former. ///

///
@@ -146,14 +146,14 @@ public virtual string BuildExtensionField(string extensionKey) /// beginning. Special Query characters are escaped in the result. ///

/// Note: subclasses must maintain the contract between - /// and - /// where the latter inverts the + /// and + /// where the latter inverts the /// former. ///

/// the extension key /// the field to apply the extension on. /// escaped extension field identifier - /// See to use the default query field + /// See to use the default query field public virtual string BuildExtensionField(string extensionKey, string field) { StringBuilder builder = new StringBuilder(field); diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs b/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs index 386c9ade1a..8136f0ffbf 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/CharStream.cs @@ -30,7 +30,7 @@ namespace Lucene.Net.QueryParsers.Surround.Parser /// All the methods except backup can be implemented in any fashion. backup /// needs to be implemented correctly for the correct operation of the lexer. /// Rest of the methods are all used to get information like line number, - /// column number and the String that constitutes a token and are not used + /// column number and the string that constitutes a token and are not used /// by the lexer. Hence their implementation won't affect the generated lexer's /// operation. ///
@@ -117,7 +117,7 @@ public interface ICharStream /// implementation of this is as follows : /// /// { - /// String t = GetImage(); + /// string t = GetImage(); /// return t.substring(t.length() - len, t.length()).toCharArray(); /// } /// diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs b/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs index 16a548e058..24a7102c9a 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/FastCharStream.cs @@ -103,7 +103,7 @@ public void Backup(int amount) public string Image { - get { return new System.String(buffer, tokenStart, bufferPosition - tokenStart); } + get { return new string(buffer, tokenStart, bufferPosition - tokenStart); } } public char[] GetSuffix(int len) diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs index 4b1e7f28dc..6f7ed81c04 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/ParseException.cs @@ -217,7 +217,7 @@ internal static string Add_escapes(string str) default: if ((ch = str[i]) < 0x20 || ch > 0x7e) { - System.String s = "0000" + System.Convert.ToString(ch, 16); + string s = "0000" + System.Convert.ToString(ch, 16); retval.Append("\\u" + s.Substring(s.Length - 4, (s.Length) - (s.Length - 4))); } else diff --git a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs index afdfc64a92..bdab9cad5c 100644 --- a/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs +++ b/src/Lucene.Net.QueryParser/Surround/Parser/QueryParser.cs @@ -142,12 +142,12 @@ protected virtual SrndQuery GetDistanceQuery( } protected virtual SrndQuery GetTermQuery( - String term, bool quoted) + string term, bool quoted) { return new SrndTermQuery(term, quoted); } - protected virtual bool AllowedSuffix(String suffixed) + protected virtual bool AllowedSuffix(string suffixed) { return (suffixed.Length - 1) >= minimumPrefixLength; } diff --git a/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs index 7e4217df99..516934367c 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/DistanceQuery.cs @@ -80,7 +80,7 @@ public virtual void AddSpanQueries(SpanNearClauseFactory sncf) public virtual Search.Query GetSpanNearQuery( IndexReader reader, - String fieldName, + string fieldName, float boost, BasicQueryFactory qf) { diff --git a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs index fe41d5cf25..89b8459962 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/RewriteQuery.cs @@ -28,7 +28,7 @@ internal abstract class RewriteQuery : Search.Query public RewriteQuery( SQ srndQuery, - String fieldName, + string fieldName, BasicQueryFactory qf) { this.srndQuery = srndQuery; diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs index 6f850e0c33..cffa38adf2 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndPrefixQuery.cs @@ -22,7 +22,7 @@ namespace Lucene.Net.QueryParsers.Surround.Query */ /// - /// Query that matches String prefixes + /// Query that matches string prefixes /// public class SrndPrefixQuery : SimpleTerm { From 630ddf4434dae8fc88aed8a1c2bb5a9bd538467f Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Sat, 24 Sep 2016 16:52:33 +0700 Subject: [PATCH 11/11] Optimized QueryParser.Surround.Query.SrndTruncQuery to fail fast if the Regex doesn't match the entire string. --- .../Surround/Query/SrndTruncQuery.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs index 2925ce9594..8c47b3734e 100644 --- a/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs +++ b/src/Lucene.Net.QueryParser/Surround/Query/SrndTruncQuery.cs @@ -75,11 +75,18 @@ protected virtual void TruncatedToPrefixAndPattern() prefixRef = new BytesRef(prefix); StringBuilder re = new StringBuilder(); + // LUCENENET NOTE: To mimic Java's matches() method, we alter + // the Regex to match the entire string. This makes the Regex + // fail fast when not at the beginning of the string, which is + // more efficient than testing the length after a successful match. + // http://stackoverflow.com/a/12547528/181087 + re.Append(@"\A(?:"); while (i < truncated.Length) { AppendRegExpForChar(truncated[i], re); i++; } + re.Append(@")\z"); pattern = new Regex(re.ToString(), RegexOptions.Compiled); } @@ -111,13 +118,8 @@ public override void VisitMatchingTerms(IndexReader reader, string fieldName, Si if (text != null && StringHelper.StartsWith(text, prefixRef)) { string textString = text.Utf8ToString(); - // LUCENENET NOTE: Java's matches() method checks to see if the - // entire string is a match with the regex, so we mimic that - // by testing to ensure the lengths of the input and match are equal - // as well as whether it is successful. - string toMatchEntirely = textString.Substring(prefixLength); - Match matcher = pattern.Match(toMatchEntirely); - if (matcher.Success && matcher.Length == toMatchEntirely.Length) + Match matcher = pattern.Match(textString.Substring(prefixLength)); + if (matcher.Success) { mtv.VisitMatchingTerm(new Term(fieldName, textString)); }