Add channel_id parameter to search api #169
1 changed files with 14 additions and 0 deletions
|
@ -41,6 +41,19 @@ function getResults (input) {
|
||||||
let washedQuery = getEscapedQuery(getWashedQuery(trimmedQuery));
|
let washedQuery = getEscapedQuery(getWashedQuery(trimmedQuery));
|
||||||
let effectiveFactor = '0.00000000001';
|
let effectiveFactor = '0.00000000001';
|
||||||
// Search is split up into different parts, all search parts goes under this line.
|
// Search is split up into different parts, all search parts goes under this line.
|
||||||
|
let channelidSearch;
|
||||||
|
if (input.channel_id !== undefined) {
|
||||||
|
channelidSearch = { // If we got a channel_id argument, lets filter out only that channel_id
|
||||||
|
'bool': {
|
||||||
|
'must': {
|
||||||
|
'query_string': {
|
||||||
|
'fields': ['channel_id'],
|
||||||
|
'query' : getEscapedQuery(input.channel_id.trim()),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
let channelSearch;
|
let channelSearch;
|
||||||
if (input.channel !== undefined) { // If we got a channel argument, lets filter out only that channel
|
if (input.channel !== undefined) { // If we got a channel argument, lets filter out only that channel
|
||||||
channelSearch = {
|
channelSearch = {
|
||||||
|
@ -256,6 +269,7 @@ function getResults (input) {
|
||||||
],
|
],
|
||||||
'must': [
|
'must': [
|
||||||
channelSearch,
|
channelSearch,
|
||||||
|
channelidSearch,
|
||||||
{
|
{
|
||||||
'bool': {
|
'bool': {
|
||||||
'should': [
|
'should': [
|
||||||
|
|
Loading…
Reference in a new issue