title: Sequelize query multiple times
body: <p>I'm trying to improve the search on my website, this is how it currently looks (I use NodeJS, Sequelize and PostgreSQL):</p>
  
  <pre><code>db.food.findAll({
          where: {
              nameFood: {
                  $iLike: '%' + queryName + '%'
              }
          }
      }).then(function (foods) {
          foods.sort(compareFood);
  
          res.json(foods);
      }, function (e) {
          res.status(500).send();
      });
  </code></pre>
  
  <p>I think it is pretty self explanatory, but if something isn't clear just ask me on the comments.</p>
  
  <p>Now, this search algorithm takes into consideration the WHOLE parameter, so searching for "chicken eggs" would return nothing since on my database they're saved as "eggs". </p>
  
  <p>My idea for a quick improvement would be to split the query looking for spaces and then query each keyword, something like:</p>
  
  <pre><code>var keywords = queryName.split(' ');
  </code></pre>
  
  <p>With that I have the keywords, now how can I query a variable number of times and join the result in an array to be returned like the one in foods?</p>
  
  <p>I checked the documentation and some questions in here but couldn't find anything, any help is appreciated, thank you so much.</p>