@@ -5,7 +5,7 @@ class AzureSearchClient {
55
66 async indexExistsAsync ( ) {
77 console . log ( "\n Checking if index exists..." ) ;
8- const endpoint = this . searchServiceHelper . getIndexExistsUrl ( ) ;
8+ const endpoint = this . searchServiceHelper . getIndexUrl ( ) ;
99 const response = await this . searchServiceHelper . request ( endpoint , "GET" , null ) ;
1010 // Success has a few likely status codes: 200 or 204 (No Content), but accept all in 200 range...
1111 const exists = response . status >= 200 && response . status < 300 ;
@@ -14,21 +14,21 @@ class AzureSearchClient {
1414
1515 async deleteIndexAsync ( ) {
1616 console . log ( "\n Deleting existing index..." ) ;
17- const endpoint = this . searchServiceHelper . getIndexExistsUrl ( ) ;
17+ const endpoint = this . searchServiceHelper . getIndexUrl ( ) ;
1818 const response = await this . searchServiceHelper . request ( endpoint , "DELETE" ) ;
1919 this . searchServiceHelper . throwOnHttpError ( response ) ;
2020 return this ;
2121 }
2222
2323 async createIndexAsync ( definition ) {
2424 console . log ( "\n Creating index..." ) ;
25- const endpoint = this . searchServiceHelper . getCreateIndexUrl ( ) ;
25+ const endpoint = this . searchServiceHelper . getIndexUrl ( ) ;
2626 const response = await this . searchServiceHelper . request ( endpoint , "PUT" , definition ) ;
2727 this . searchServiceHelper . throwOnHttpError ( response ) ;
2828 return this ;
2929 }
3030
31- async loadDataAsync ( hotelsData ) {
31+ async postDataAsync ( hotelsData ) {
3232 console . log ( "\n Adding hotel data..." ) ;
3333 const endpoint = this . searchServiceHelper . getPostDataUrl ( ) ;
3434 const response = await this . searchServiceHelper . request ( endpoint , "POST" , hotelsData ) ;
0 commit comments