Revert "Updated search query" #82
1 changed files with 99 additions and 111 deletions
|
@ -39,29 +39,6 @@ function getResults (input) {
|
||||||
_source: ['name', 'value', 'claimId'],
|
_source: ['name', 'value', 'claimId'],
|
||||||
body : {
|
body : {
|
||||||
'query': {
|
'query': {
|
||||||
'bool': {
|
|
||||||
'should': [
|
|
||||||
{
|
|
||||||
'match': {
|
|
||||||
'bid_state': {
|
|
||||||
// Controlling claims should get higher placement in search results.
|
|
||||||
'query': 'Controlling',
|
|
||||||
'boost': 20,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'function_score': {
|
|
||||||
'script_score': {
|
|
||||||
'script': { // 100 LBC adds 1 point to the score
|
|
||||||
'source': "0.00000001 * doc['effective_amount'].value",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'must': [
|
|
||||||
{
|
|
||||||
'bool': {
|
'bool': {
|
||||||
'should': [
|
'should': [
|
||||||
{ // Match search text as phrase - Name
|
{ // Match search text as phrase - Name
|
||||||
|
@ -162,15 +139,26 @@ function getResults (input) {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
size: input.size,
|
||||||
|
from: input.from,
|
||||||
|
},
|
||||||
|
/* body : {
|
||||||
|
'query': {
|
||||||
|
'bool': {
|
||||||
|
'must': {
|
||||||
|
'query_string': {
|
||||||
|
'query' : '*' + input.s.trim() + '*',
|
||||||
|
'fields': [
|
||||||
|
'name',
|
||||||
|
'value.stream.metadata.author',
|
||||||
|
'value.stream.metadata.title',
|
||||||
|
'value.stream.metadata.description',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
size: input.size,
|
|
||||||
from: input.from,
|
|
||||||
sort: {
|
|
||||||
_score: 'desc',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
}, */
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue