Only consider the 1st 3 terms in a search query for subqueries as they are likely to be related content searches and do not need to be so precise.

This commit is contained in:
Mark Beamer Jr 2019-07-16 20:30:15 -04:00
parent 7e99d9eace
commit 32ebc7ac9f
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -86,7 +86,8 @@ function getResults (input) {
let queries = [];
let conCatTerm = '';
let phraseTerm = '';
escapedQuery.split(' ').forEach((term) => {
escapedQuery.split(' ').every((term, index) => {
if (index === 4) { return false }
phraseTerm = phraseTerm + ' ' + term;
conCatTerm = conCatTerm + term;
queries.push(
@ -129,7 +130,8 @@ function getResults (input) {
};
const splitATD = () => {
let queries = [];
escapedQuery.split(' ').forEach((term) => {
escapedQuery.split(' ').every((term, index) => {
if (index === 4) { return false }
queries.push({ // Contains search term in Author, Title, Description
'query_string': {
'query' : `*${term}*`,