lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Fixing possible exception due to key already existing
Date Tue, 07 Apr 2015 16:18:27 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/3.0.3 770649bf9 -> 849f24420


Fixing possible exception due to key already existing


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

Branch: refs/heads/3.0.3
Commit: 849f244201619ca90099b5e1fafa81c4cd2fbc7e
Parents: 770649b
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Tue Apr 7 19:18:03 2015 +0300
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Tue Apr 7 19:18:03 2015 +0300

----------------------------------------------------------------------
 src/contrib/FastVectorHighlighter/FieldQuery.cs | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/849f2442/src/contrib/FastVectorHighlighter/FieldQuery.cs
----------------------------------------------------------------------
diff --git a/src/contrib/FastVectorHighlighter/FieldQuery.cs b/src/contrib/FastVectorHighlighter/FieldQuery.cs
index 9d5d198..d2af2e9 100644
--- a/src/contrib/FastVectorHighlighter/FieldQuery.cs
+++ b/src/contrib/FastVectorHighlighter/FieldQuery.cs
@@ -17,9 +17,6 @@
 
 using System;
 using System.Collections.Generic;
-using System.Text;
-
-using Lucene.Net.Search;
 using Lucene.Net.Index;
 using Lucene.Net.Support.Compatibility;
 using TermInfo = Lucene.Net.Search.Vectorhighlight.FieldTermStack.TermInfo;
@@ -78,7 +75,7 @@ namespace Lucene.Net.Search.Vectorhighlight
             else if (sourceQuery is PrefixQuery)
             {
                 if (!flatQueries.ContainsKey(sourceQuery))
-                    flatQueries.Add(sourceQuery, sourceQuery);
+                    flatQueries[sourceQuery] = sourceQuery;
             }
             else if (sourceQuery is DisjunctionMaxQuery)
             {
@@ -91,7 +88,7 @@ namespace Lucene.Net.Search.Vectorhighlight
             else if (sourceQuery is TermQuery)
             {
                 if (!flatQueries.ContainsKey(sourceQuery))
-                    flatQueries.Add(sourceQuery, sourceQuery);
+                    flatQueries[sourceQuery] = sourceQuery;
             }
             else if (sourceQuery is PhraseQuery)
             {
@@ -103,7 +100,7 @@ namespace Lucene.Net.Search.Vectorhighlight
                     else if (pq.GetTerms().Length == 1)
                     {
                         Query q = new TermQuery(pq.GetTerms()[0]);
-                        flatQueries.Add(q, q);
+                        flatQueries[q] = q;
                     }
                 }
             }
@@ -144,7 +141,7 @@ namespace Lucene.Net.Search.Vectorhighlight
             {
                 //Query query = i.next();
                 flatQueries.Remove(query);
-                expandQueries.Add(query, query);
+                expandQueries[query] = query;
                 if (!(query is PhraseQuery)) continue;
                 foreach (Query qj in flatQueries.Keys)
                 {
@@ -213,7 +210,7 @@ namespace Lucene.Net.Search.Vectorhighlight
                     pq.Slop = slop;
                     pq.Boost = boost;
                     if (!expandQueries.ContainsKey(pq))
-                        expandQueries.Add(pq, pq);
+                        expandQueries[pq] = pq;
                 }
             }
         }


Mime
View raw message