Reindex programatically ais_search Indexed Sources

German Alvarez1
Tera Contributor

Due to some problems we are observing in some of our indexed sources, we see the necessity, to launch "Index Selected Tables" with some frequency manually.

 

We are wondering if, it is possible to run it via Scheduled Job, meanwhile we stabilize the traffic on this indexed source.

 

We were able to find the "Modal" which executes a GlideAjax Call to "AisConfigurationAjax", which, supossely, will call "AisConfigurationUtil", but since this code is protected, we can't guess which method in Server Side we need to call.

 

 

function index() {
     var table = gel('table').value;
     var gm = GlideModal.prototype.get('ais_index_single_table');
     var sysId = gm.getPreference('sys_id');
     var datasource = gm.getPreference('datasource');
     if (!table) {
         alert(new GwtMessage().getMessage("Please select a table to be indexed"));
         return false;
     }
     var ga = new GlideAjax('AisConfigurationAjax');
     ga.addParam('sysparm_name', 'indexSingleTableNoBlocking');
     ga.addParam('sysparm_ais_datasource', datasource);
     ga.addParam('sysparm_ais_table', table);
     ga.getXML(function(response) {
         var id = response.responseXML.documentElement.getAttribute("answer");
         if (id) {
           var url = '/ais_ingest_datasource_stats.do?sys_id='; url += id;
           window.location = url;
        }
// ...

 

 

If you can help us, it will be really useful.

 

 

2 REPLIES 2

Shree123
Tera Contributor

Hi @German Alvarez1 

Were you able to find a way to schedule indexing? Or was there any other workaround?
I have a similar requirement as well. Will be helpful if I could get any idea.

 

Thank you

Vignesh Roshan
Tera Contributor

Any Update on this question?

Were you able to find a way to schedule indexing? Or was there any other workaround?

I have a similar requirement as well. Will be helpful if I could get any idea.