samples/textDetection.js
async function extractDescriptions(filename, index, response) {
  if (response.textAnnotations.length) {
    const words = extractDescription(response.textAnnotations);
    await index.add(filename, words);
  } else {
    console.log(`${filename} had no discernable text.`);
    await index.setContainsNoText(filename);
  }
}
async function extractDescriptions(filename, index, response) {
  if (response.textAnnotations.length) {
    const words = extractDescription(response.textAnnotations);
    await index.add(filename, words);
  } else {
    console.log(`${filename} had no discernable text.`);
    await index.setContainsNoText(filename);
  }
}
async function extractDescriptions ( filename , index , response ) { if ( response . textAnnotations . length ) { const words = extractDescription ( response . textAnnotations ) ; await index . add ( filename , words ) ; } else { console . log ( ` ${ filename } ` ) ; await index . setContainsNoText ( filename ) ; } }
Grab the description, and push it into redis.
@param {string} filename Name of the file being processed
@param {Index} index The Index object that wraps Redis
@param {*} response Individual response from the Cloud Vision API
@returns {Promise<void>}
Grab the description and push it into redis .