New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: index rebuilding #523

Closed
richardhauer opened this Issue Nov 14, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@richardhauer

richardhauer commented Nov 14, 2015

Support Index rebuilds. Async full, tree descent, and set of items via pipeline. :) if it's not too much trouble.

@michaellwest

This comment has been minimized.

Member

michaellwest commented Nov 25, 2015

Current index commands

  • Get-SearchIndex
  • Rebuild-SearchIndex
  • Resume-SearchIndex
  • Stop-SearchIndex
  • Suspend-SearchIndex

@AdamNaj AdamNaj added this to the 4.0 milestone Nov 25, 2015

@michaellwest

This comment has been minimized.

Member

michaellwest commented Nov 26, 2015

Syntax

Example: Full Rebuild of all indexes.

Get-SearchIndex | Rebuild-SearchIndex

Example: Full Rebuild on the specified index.

Rebuild-SearchIndex -Name sitecore_master_index
Get-SearchIndex -Name sitecore_master_index | Rebuild-SearchIndex

Example: Rebuild indexed item in indexes with crawlers for the same database..

Get-Item -Path "web:\content\home" | Rebuild-SearchIndexItem

Example: Remove item from all indexes with crawlers for the same database.

Get-Item -Path "web:\content\home" | Remove-SearchIndexItem

Example: Remove all items from the index.

Find-Item -Index sitecore_web_index | Remove-SearchIndexItem

Example: Rebuild the index for every item in the index.

Find-Item -Index sitecore_web_index | Rebuild-SearchIndexItem

Note: Using the AsJob switch will write each index job to the pipeline.

@michaellwest

This comment has been minimized.

Member

michaellwest commented Nov 26, 2015

Here's a quick test:

Write-Host "Rebuilding index for item"
Get-Item -Path "web:\content\home" | Rebuild-SearchIndexItem
#[Sitecore.Jobs.JobManager]::GetJobs() | Where-Object { !$_.IsDone -and $_.Category -eq "Indexing" }
Start-Sleep -Seconds 2
Write-Host "Searching for item in index"
Find-Item -Index sitecore_web_index -Criteria @{Filter = "Equals"; Field = "title"; Value = "platform"}
Remove-SearchIndexItem -Item (Get-Item -Path "web:\content\home")
Start-Sleep -Seconds 2
Write-Host "Searching for item removed from index"
Find-Item -Index sitecore_web_index -Criteria @{Filter = "Equals"; Field = "title"; Value = "platform"}
Rebuilding index for item
Searching for item in index

Name                             Lang.   Version Database     Item Id                                Template Name
----                             -----   ------- --------     -------                                -------------
Home                             en      1       web          {110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9} Sample Item
Searching for item removed from index
@AdamNaj

This comment has been minimized.

Member

AdamNaj commented Dec 14, 2015

Consider that finished

@AdamNaj AdamNaj closed this Dec 14, 2015

@richardhauer

This comment has been minimized.

richardhauer commented Dec 14, 2015

 Neat.
I Guess I should postpone the 3.3 update to instead do a 3.4 update?

R

From: Adam Najmanowicz [mailto:notifications@github.com]
Sent: Monday, 14 December 2015 11:50 AM
To: SitecorePowerShell/Console Console@noreply.github.com
Cc: Richard Hauer Richard.Hauer@ping-works.com.au
Subject: Re: [Console] Feature Request: index rebuilding (#523)

Consider that finished


Reply to this email directly or view it on GitHubhttps://github.com//issues/523#issuecomment-164315973.
 

  

@michaellwest

This comment has been minimized.

Member

michaellwest commented Dec 14, 2015

There were definitely enough improvements in 3.3 to make upgrading worth it. This'll roll out as 4.0.

@michaellwest michaellwest removed their assignment May 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment