Is it possible to reschedule indexing fresh from a sql server agent job

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
2/19/2012 9:27:45 PM
Gravatar
Total Posts 12

Is it possible to reschedule indexing fresh from a sql server agent job

Is it possible after cleaning the index directory to start the indexing job from a scheduled task at windows or from sql server agent job?

2/20/2012 5:55:33 AM
Gravatar
Total Posts 18439

Re: Is it possible to reschedule indexing fresh from a sql server agent job

Since the index will be rebuilt upon the first search request if the index folder is empty, you could make a web request to the search page like http://yoursiteroot/SearchResults.aspx?q=foo

and that should kick off the indexing process.

I know it is possible to make a web request from .NET code in a windows service, I'm not sure if it can be done from a sql task.

Hope that helps,

Joe

2/20/2012 8:26:44 AM
Gravatar
Total Posts 12

Re: Is it possible to reschedule indexing fresh from a sql server agent job

perfect, I'll look into this, would it work by any request to that link, meaning do I have to worry if the user must be logged on or the user must be administrator or does the link url vary between user logons?

I mean will it be always a simple request to http://yoursiteroot/SearchResults.aspx?q=foo and I don't have to worry about login to the site etc, and how to know this worked, just wait for couple minutes and if any files generated in the index directory or is there another monitoring for it?

Thank you so much :-)

2/20/2012 8:50:25 AM
Gravatar
Total Posts 18439

Re: Is it possible to reschedule indexing fresh from a sql server agent job

yes it will work as I mentioned just making any search request, it does require some search param ( I used foo in my example) but it doesn't require authentication an dit will kick off th eprocess of completely re-indexing the site. The process can take some time especially for a large site. It is possible to monitor progress to some degree under Administration > Advanced Tools > Task Queue

It will take a minute or so for the task to begin and it will first create index items for each indexable content and serializes them into the mp_IndexingQueue table, than a process on a background thread works its way through those rows writing to the file based index. You will see files appear as soon as it starts processing rows but the files will change a lot until it finishes and then optimizes the files.

If unprocessed rows already exist in the mp_IndexingQueue table it will not rebuild the index because it will think it is already in progress so your steps of your task should probably be

1. Truncate the mp_IndexingQueue table

2. Delete all files from the index folder

3. Make the web request for any random search as indicated previously to trigger re-indexing

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.