AzureSearch / AzureSearchNodeJSIndexerDemo

NodeJS program that creates an Azure Search index and automatically populates it with data from a SQL Azure instance using indexers.
10 stars 4 forks source link

undefined body throws error on setInterval #2

Open amragaey360 opened 7 years ago

amragaey360 commented 7 years ago

on running npm run indexDocuments I got the below error. As the code isn't handling undefined body response in setInterval for indexer status.

`success, items processed: 6696 undefined undefined:1 undefined ^

SyntaxError: Unexpected token u in JSON at position 0 at Object.parse (native) at Request._callback (C:\Users\AmrRagaey-PC\Desktop\azuredemo\js\DataIndexer\DataIndexer.js:228:31) at self.callback (C:\Users\AmrRagaey-PC\Desktop\azuredemo\node_modules\request\request.js:186:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Request.onRequestError (C:\Users\AmrRagaey-PC\Desktop\azuredemo\node_modules\request\request.js:845:8) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) `

konstmsu commented 7 years ago

@amragaey360 you need to modify config.js to supply apiKey, queyrKey and serviceUrl as described in https://docs.microsoft.com/en-us/azure/search/search-get-started-nodejs#find-the-service-name-and-api-key-of-your-azure-search-service

konstmsu commented 7 years ago

Although it seems that your upload has completed successfully so I'm probably wrong.