Add channel_id parameter to search to restrict results to claims published to a specific channel's claim_id. This helps refine search for channels that have many bidding with the same name.

This commit is contained in:
Mark Beamer Jr 2019-09-19 22:44:31 -04:00
parent 4b88db1f55
commit 383626525d
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -41,6 +41,19 @@ function getResults (input) {
let washedQuery = getEscapedQuery(getWashedQuery(trimmedQuery));
let effectiveFactor = '0.00000000001';
// 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;
if (input.channel !== undefined) { // If we got a channel argument, lets filter out only that channel
channelSearch = {
@ -256,6 +269,7 @@ function getResults (input) {
],
'must': [
channelSearch,
channelidSearch,
{
'bool': {
'should': [