Hello,
Thank you for the clarifications. To reindex all entities, please submit the following code:
# First you have to get the authentication token
filename resp TEMP;
filename hdrs TEMP;
proc http url="http://<your-domain-name>/SASLogon/oauth/token"
method='POST' auth_basic webusername="sas.ec" webpassword=""
in='grant_type=password&username=<your-user-name>&password=<your-password>'
out=resp
headerout=hdrs;
run;
# Put the token in the access_token macro variable
data _null_;
infile resp truncover dlm='"' ;
input @'"access_token":"' token :$2000. ;
call symputx('access_token',token,'g');
run;
# Launch the reindexing job through the API
proc http url="http://<your-domain-name>/svi-datahub/admin/asyncJobs?new"
method='POST' OAUTH_BEARER="&access_token."
in='{"parameters": {"type": "SEARCH_INDEX_LOADER"}}';
headers 'Accept'='application/json' 'Content-Type'='text/plain';
run;
I only changed the final request's input. Please let me know if you have additional questions.
Have a good day,
JD
Hello,
I'm not familiar with SAS LSF but if you want to update your external entity and see the changes into VI, you just have to reindex the entity after updating your table. You can do it automatically with rest api calls; in SAS you should use the proc http: you just have to change the fields between "<>":
# First you have to get the authentication token
filename resp TEMP;
filename hdrs TEMP;
proc http url="http://<your-domain-name>/SASLogon/oauth/token" method='POST' auth_basic webusername="sas.ec" webpassword="" in='grant_type=password&username=<your-user-name>&password=<your-password>' out=resp headerout=hdrs; run;
# Put the token in the access_token macro variable
data _null_;
infile resp truncover dlm='"' ;
input @'"access_token":"' token :$2000. ;
call symputx('access_token',token,'g');
run;
# Launch the reindexing job through the API
proc http url="http://<your-domain-name>/svi-datahub/admin/asyncJobs?new"
method='POST' OAUTH_BEARER="&access_token."
in='{"parameters": {"type": "SEARCH_INDEX_LOADER"},"tasks": [{"parameters": {"type": "LOAD_DOCUMENT","name": "<your-entity-name>"}}]}';
headers 'Accept'='application/json' 'Content-Type'='text/plain';
run;
Hope this will help.
Cheers,
JD
Hello,
I'm happy to help; if I understand well the reindexing is OK for you, but you want to reload your data in-memory?
Could you please describe what should be your reload process? Do you want to load data into a CAS table? Could you also tell me which type of datasource are you using for your external entity (PostgreSQL, MySQL, ...)?
Thank you for your answers,
JD
Hello,
Thank you for the clarifications. To reindex all entities, please submit the following code:
# First you have to get the authentication token
filename resp TEMP;
filename hdrs TEMP;
proc http url="http://<your-domain-name>/SASLogon/oauth/token"
method='POST' auth_basic webusername="sas.ec" webpassword=""
in='grant_type=password&username=<your-user-name>&password=<your-password>'
out=resp
headerout=hdrs;
run;
# Put the token in the access_token macro variable
data _null_;
infile resp truncover dlm='"' ;
input @'"access_token":"' token :$2000. ;
call symputx('access_token',token,'g');
run;
# Launch the reindexing job through the API
proc http url="http://<your-domain-name>/svi-datahub/admin/asyncJobs?new"
method='POST' OAUTH_BEARER="&access_token."
in='{"parameters": {"type": "SEARCH_INDEX_LOADER"}}';
headers 'Accept'='application/json' 'Content-Type'='text/plain';
run;
I only changed the final request's input. Please let me know if you have additional questions.
Have a good day,
JD
Hi
Is there any way to capture when the indexing is complete ?
I have jobs to be executed in batch post indexing. If I am able to capture when the indexing triggered via API call is complete, it would be helpful to trigger next job. Currently I am just using sleep function to hold the next job.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.