code: function getExpandedQuery(basicQuery) {
        let expandedQuery = [];
        const needsExpandedQuery = isExpandableQuery(basicQuery);
  
        if (!needsExpandedQuery) {
          expandedQuery = basicQuery;
        } else {
          _.each(basicQuery, (query, i) => {
            let thisNonExpandableQueryWasAlreadyCloned = false;
            const isExpandableQueryLine = isAlongExpandableQueryLine(query);
            _.each(query.nested.query.bool.must, (innerQuery, mustI) => {
              const matchObj = innerQuery.nested.query.match;
              const values = _.values(matchObj);
              if (values.length > 1) {
                console.warn('[Elastic-Harvest] Our match query isn\'t supposed to have multiple keys in it. We expect ' +
                  'something like { match: { name: "Peter " } }, and you\'ve constructed a match like { match: { name: ' +
                  '"Peter", type: "person" } }');
                throw Error('The query expansion algorithm does not expect this query form.');
              }
              if (_.isArray(values[0])) {
                _.each(values[0], (value) => {
                  const key = _.keys(matchObj)[0];
                  const newQuery = _.cloneDeep(basicQuery);
                  const relatedMatchObj = newQuery[i].nested.query.bool.must[mustI].nested.query.match;
                  relatedMatchObj[key] = value;
                  expandedQuery.push(newQuery[i]);
                });
              } else if (!isExpandableQueryLine && !thisNonExpandableQueryWasAlreadyCloned) {
                // the only queries that get cloned are the ones on the query line of the expanded query.
                expandedQuery.push(basicQuery[i]);
                thisNonExpandableQueryWasAlreadyCloned = true;
              }
            });
          });
        }
  
        return expandedQuery;
      }
docs: Handles the case where multiple values are submitted for one key
  This transforms a query that tries to match something like {match:{links.husband.name:["Peter","Solomon"]} to
  one that instead duplicates all parts of the query and splits it so each match term has it's own search query.
  This was done so searches would not be unduely limited by the nested level.