Skip to content

Instantly share code, notes, and snippets.

@BenGGolden
Last active January 21, 2017 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenGGolden/71187ea593d8b00706f23280932eb47e to your computer and use it in GitHub Desktop.
Save BenGGolden/71187ea593d8b00706f23280932eb47e to your computer and use it in GitHub Desktop.
$item = Get-Item .
$options = @{}
[Sitecore.ContentSearch.ContentSearchManager]::Indexes | Foreach-Object { $options.Add($_.Name, $_.Name) }
$props = @{
Parameters = @(
@{Name="indexName"; Title="Choose an index"; Options=$options; Tooltip="Choose one."}
)
Title = "Index selector"
Description = "Choose an index."
Width = 300
Height = 300
ShowHints = $true
}
$result = Read-Variable @props
if ($result -eq "ok") {
$index = [Sitecore.ContentSearch.ContentSearchManager]::GetIndex($indexName)
[Sitecore.ContentSearch.Maintenance.IndexCustodian]::Refresh($index, [Sitecore.ContentSearch.SitecoreIndexableItem]$item)
}
Close-Window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment