Lucene.Net.Grouping: added WritableArray and SuppressMessage attribute to public array properties
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/1dccd774 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/1dccd774 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/1dccd774 Branch: refs/heads/api-work Commit: 1dccd77405a0d567790009734651d047ffa72b1f Parents: d604cab Author: Shad Storhaug <[email protected]> Authored: Wed Feb 1 14:26:32 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Wed Feb 1 14:26:32 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Grouping/GroupDocs.cs | 8 +++++++- src/Lucene.Net.Grouping/SearchGroup.cs | 3 +++ src/Lucene.Net.Grouping/TopGroups.cs | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1dccd774/src/Lucene.Net.Grouping/GroupDocs.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Grouping/GroupDocs.cs b/src/Lucene.Net.Grouping/GroupDocs.cs index c997e30..34c2ccd 100644 --- a/src/Lucene.Net.Grouping/GroupDocs.cs +++ b/src/Lucene.Net.Grouping/GroupDocs.cs @@ -1,4 +1,5 @@ -using Lucene.Net.Search; +using Lucene.Net.Support; +using System.Diagnostics.CodeAnalysis; namespace Lucene.Net.Search.Grouping { @@ -46,6 +47,8 @@ namespace Lucene.Net.Search.Grouping /// Hits; this may be <see cref="FieldDoc"/> instances if the /// withinGroupSort sorted by fields. /// </summary> + [WritableArray] + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public ScoreDoc[] ScoreDocs { get; private set; } /// <summary> @@ -56,6 +59,8 @@ namespace Lucene.Net.Search.Grouping /// <summary> /// Matches the groupSort passed to <see cref="AbstractFirstPassGroupingCollector{TGroupValue}"/>. /// </summary> + [WritableArray] + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public object[] GroupSortValues { get; private set; } public GroupDocs(float score, float maxScore, int totalHits, ScoreDoc[] scoreDocs, TGroupValue groupValue, object[] groupSortValues) @@ -96,6 +101,7 @@ namespace Lucene.Net.Search.Grouping /// Hits; this may be <see cref="FieldDoc"/> instances if the /// withinGroupSort sorted by fields. /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] ScoreDoc[] ScoreDocs { get; } /// <summary> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1dccd774/src/Lucene.Net.Grouping/SearchGroup.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Grouping/SearchGroup.cs b/src/Lucene.Net.Grouping/SearchGroup.cs index 565ab15..cad33f3 100644 --- a/src/Lucene.Net.Grouping/SearchGroup.cs +++ b/src/Lucene.Net.Grouping/SearchGroup.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Lucene.Net.Search.Grouping @@ -43,6 +44,8 @@ namespace Lucene.Net.Search.Grouping /// <c>null</c> if <c>fillFields=false</c> had /// been passed to <see cref="AbstractFirstPassGroupingCollector{TGroupValue}.GetTopGroups(int, bool)"/> /// </summary> + [WritableArray] + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public object[] SortValues { get; set; } public override string ToString() http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1dccd774/src/Lucene.Net.Grouping/TopGroups.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Grouping/TopGroups.cs b/src/Lucene.Net.Grouping/TopGroups.cs index d8a2165..132957c 100644 --- a/src/Lucene.Net.Grouping/TopGroups.cs +++ b/src/Lucene.Net.Grouping/TopGroups.cs @@ -1,4 +1,6 @@ -using System; +using Lucene.Net.Support; +using System; +using System.Diagnostics.CodeAnalysis; namespace Lucene.Net.Search.Grouping { @@ -40,14 +42,20 @@ namespace Lucene.Net.Search.Grouping /// <summary> /// Group results in groupSort order </summary> + [WritableArray] + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public IGroupDocs<TGroupValue>[] Groups { get; private set; } /// <summary> /// How groups are sorted against each other </summary> + [WritableArray] + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public SortField[] GroupSort { get; private set; } /// <summary> /// How docs are sorted within each group </summary> + [WritableArray] + [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")] public SortField[] WithinGroupSort { get; private set; } /// <summary>
