Skip to content
Permalink
Browse files

Only consider the 1st 3 terms in a search query for subqueries as the…

…y are likely to be related content searches and do not need to be so precise.
  • Loading branch information...
tiger5226 committed Jul 17, 2019
1 parent 7e99d9e commit 32ebc7ac9f53ad51f8f558b18b3948137f75a394
Showing with 4 additions and 2 deletions.
  1. +4 −2 server/controllers/lighthouse.js
@@ -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}*`,

0 comments on commit 32ebc7a

Please sign in to comment.
You can’t perform that action at this time.