You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.0 KiB

9 years ago
module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'analyzer': 'peliasQueryFullToken',
'type': 'phrase',
'boost': 1,
'slop': 3,
'cutoff_frequency': 0.01,
'query': 'one two'
}
}
},
{
'constant_score': {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasQueryPartialToken',
'boost': 100,
'query': 'three',
'type': 'phrase',
'operator': 'and',
'cutoff_frequency': 0.01,
'slop': 3
}
}
}
}
}],
'should':[
{
'match': {
'phrase.default': {
'analyzer' : 'peliasPhrase',
'type' : 'phrase',
'boost' : 1,
'slop' : 3,
'cutoff_frequency': 0.01,
'query' : 'one two'
}
}
},
{
'function_score': {
'query': {
'match_all': {}
9 years ago
},
'max_boost': 20,
'score_mode': 'first',
'boost_mode': 'replace',
'functions': [{
'field_value_factor': {
'modifier': 'log1p',
'field': 'popularity',
'missing': 1
},
'weight': 1
}]
}
},{
'function_score': {
'query': {
'match_all': {}
},
'max_boost': 20,
'score_mode': 'first',
'boost_mode': 'replace',
'functions': [{
'field_value_factor': {
'modifier': 'log1p',
'field': 'population',
'missing': 1
},
'weight': 3
9 years ago
}]
}
}]
9 years ago
}
},
'sort': [ '_score' ],
'size': 20,
9 years ago
'track_scores': true
};