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 queries = [];
|
||||||
let conCatTerm = '';
|
let conCatTerm = '';
|
||||||
let phraseTerm = '';
|
let phraseTerm = '';
|
||||||
escapedQuery.split(' ').forEach((term) => {
|
escapedQuery.split(' ').every((term, index) => {
|
||||||
|
if (index === 4) { return false }
|
||||||
phraseTerm = phraseTerm + ' ' + term;
|
phraseTerm = phraseTerm + ' ' + term;
|
||||||
conCatTerm = conCatTerm + term;
|
conCatTerm = conCatTerm + term;
|
||||||
queries.push(
|
queries.push(
|
||||||
|
@ -129,7 +130,8 @@ function getResults (input) {
|
||||||
};
|
};
|
||||||
const splitATD = () => {
|
const splitATD = () => {
|
||||||
let queries = [];
|
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
|
queries.push({ // Contains search term in Author, Title, Description
|
||||||
'query_string': {
|
'query_string': {
|
||||||
'query' : `*${term}*`,
|
'query' : `*${term}*`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue