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:
parent
7e99d9eace
commit
32ebc7ac9f
1 changed files with 4 additions and 2 deletions
|
@ -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}*`,
|
||||
|
|
Loading…
Reference in a new issue