Skip to content

Commit 3472cd0

Browse files
committed
#435 : Updated formatting and added IsRebuilding property.
1 parent 7711ba4 commit 3472cd0

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

Cognifide.PowerShell/Commandlets/BaseIndexCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class BaseIndexCommand : BaseCommand
99
private readonly string[] indexes = ContentSearchManager.Indexes.Select(i => i.Name).ToArray();
1010

1111
[ValidateSet("*")]
12-
[Parameter(ValueFromPipeline = true, Position = 0, ParameterSetName = "Name")]
12+
[Parameter(ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Position = 0, ParameterSetName = "Name")]
1313
public string Name { get; set; }
1414

1515
public override object GetDynamicParameters()

Cognifide.PowerShell/Commandlets/Data/Search/GetSearchIndexCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Management.Automation;
1+
using System;
2+
using System.Management.Automation;
23
using Sitecore.ContentSearch;
34

45
namespace Cognifide.PowerShell.Commandlets.Data.Search
@@ -11,10 +12,12 @@ protected override void ProcessRecord()
1112
{
1213
if (Name != null)
1314
{
15+
WriteVerbose(String.Format("Getting index with name {0}.", Name));
1416
WildcardWrite(Name, ContentSearchManager.Indexes, index => index.Name);
1517
}
1618
else
1719
{
20+
WriteVerbose("Getting all indexes.");
1821
WriteObject(ContentSearchManager.Indexes, true);
1922
}
2023
}

Cognifide.PowerShell/Commandlets/Data/Search/InitializeSearchIndexCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Cognifide.PowerShell.Commandlets.Data.Search
99
[Cmdlet(VerbsData.Initialize, "SearchIndex", DefaultParameterSetName = "Name")]
1010
public class InitializeSearchIndexCommand : BaseIndexCommand
1111
{
12-
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0, ParameterSetName = "Instance")]
12+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Position = 0, ParameterSetName = "Instance")]
1313
public ISearchIndex Index { get; set; }
1414

1515
[Parameter]

Cognifide.PowerShell/sitecore modules/PowerShell/Assets/Sitecore.Types.ps1xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@
107107
<Type>
108108
<Name>Sitecore.ContentSearch.LuceneProvider.LuceneIndex</Name>
109109
<Members>
110+
<ScriptProperty>
111+
<Name>IsRebuilding</Name>
112+
<GetScriptBlock>
113+
[Sitecore.ContentSearch.Maintenance.IndexCustodian]::IsRebuilding($this)
114+
</GetScriptBlock>
115+
</ScriptProperty>
110116
<MemberSet>
111117
<Name>PsStandardMembers</Name>
112118
<Members>
@@ -115,18 +121,7 @@
115121
<ReferencedProperties>
116122
<Name>Name</Name>
117123
<Name>IndexingState</Name>
118-
<Name>IsSharded</Name>
119-
</ReferencedProperties>
120-
</PropertySet>
121-
<NoteProperty>
122-
<Name>DefaultDisplayProperty</Name>
123-
<Value>Name</Value>
124-
</NoteProperty>
125-
<PropertySet>
126-
<Name>DefaultKeyPropertySet</Name>
127-
<ReferencedProperties>
128-
<Name>Name</Name>
129-
<Name>IndexingState</Name>
124+
<Name>IsRebuilding</Name>
130125
<Name>IsSharded</Name>
131126
</ReferencedProperties>
132127
</PropertySet>

Cognifide.PowerShell/sitecore modules/PowerShell/Assets/Sitecore.Views.ps1xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,11 @@
665665
<Width>15</Width>
666666
<Alignment>left</Alignment>
667667
</TableColumnHeader>
668+
<TableColumnHeader>
669+
<Label>IsRebuilding</Label>
670+
<Width>15</Width>
671+
<Alignment>left</Alignment>
672+
</TableColumnHeader>
668673
<TableColumnHeader>
669674
<Label>IsSharded</Label>
670675
<Width>10</Width>
@@ -680,6 +685,9 @@
680685
<TableColumnItem>
681686
<PropertyName>IndexingState</PropertyName>
682687
</TableColumnItem>
688+
<TableColumnItem>
689+
<PropertyName>IsRebuilding</PropertyName>
690+
</TableColumnItem>
683691
<TableColumnItem>
684692
<PropertyName>IsSharded</PropertyName>
685693
</TableColumnItem>

0 commit comments

Comments
 (0)