You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2011/06/01 10:45:13 UTC
[Lucene.Net] svn commit: r1130050 -
/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/SimpleFacetedSearch.cs
Author: digy
Date: Wed Jun 1 08:45:13 2011
New Revision: 1130050
URL: http://svn.apache.org/viewvc?rev=1130050&view=rev
Log:
[LUCENENET-415] Some parallelism to constructor.
Modified:
incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/SimpleFacetedSearch.cs
Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/SimpleFacetedSearch.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/SimpleFacetedSearch.cs?rev=1130050&r1=1130049&r2=1130050&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/SimpleFacetedSearch.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/SimpleFacetedSearch/SimpleFacetedSearch.cs Wed Jun 1 08:45:13 2011
@@ -100,7 +100,7 @@ namespace Lucene.Net.Search
//BitSet1: A AND I AND 1
//BitSet2: A AND I AND 2 etc.
//and remove impossible comb's (for ex, B J 3) from list.
- foreach (var combinations in cp)
+ Parallel.ForEach(cp, combinations =>
{
OpenBitSetDISI bitSet = new OpenBitSetDISI(_Reader.MaxDoc());
bitSet.Set(0, bitSet.Size());
@@ -115,9 +115,10 @@ namespace Lucene.Net.Search
//STEP 3
if (bitSet.Cardinality() > 0)
{
- _Groups.Add(new KeyValuePair<List<string>, OpenBitSetDISI>(comb, bitSet));
+ lock(_Groups)
+ _Groups.Add(new KeyValuePair<List<string>, OpenBitSetDISI>(comb, bitSet));
}
- }
+ });
//Now _Groups has 7 rows (as <List<string>, BitSet> pairs)
}