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.

159 lines
4.1 KiB

9 years ago
module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
'must': [
{
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 2,
'query': 'one two'
}
}
}
],
'should': [
{
'match': {
'parent.country': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 800,
9 years ago
'query': 'three'
}
}
},
{
'match': {
'parent.region': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 600,
9 years ago
'query': 'three'
}
}
},
{
'match': {
'parent.region_a': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 600,
9 years ago
'query': 'three'
}
}
},
{
'match': {
'parent.county': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 400,
9 years ago
'query': 'three'
}
}
},
{
'match': {
'parent.localadmin': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 200,
9 years ago
'query': 'three'
}
}
},
{
'match': {
'parent.locality': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 200,
9 years ago
'query': 'three'
}
}
},
{
'match': {
'parent.neighbourhood': {
9 years ago
'analyzer': 'peliasAdmin',
'boost': 200,
9 years ago
'query': 'three'
}
}
},
{
'function_score': {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
9 years ago
'boost': 100,
9 years ago
'query': 'one two',
9 years ago
'type': 'phrase',
9 years ago
'operator': 'and'
}
}
},
'max_boost': 20,
'functions': [
{
'field_value_factor': {
'modifier': 'log1p',
'field': 'popularity'
},
'weight': 1
}
],
'score_mode': 'first',
'boost_mode': 'replace',
'filter': {
'exists': {
'field': 'popularity'
}
}
}
},
{
'function_score': {
'query': {
'match': {
'name.default': {
'analyzer': 'peliasPhrase',
9 years ago
'boost': 100,
9 years ago
'query': 'one two',
9 years ago
'type': 'phrase',
9 years ago
'operator': 'and'
}
}
},
'max_boost': 20,
'functions': [
{
'field_value_factor': {
'modifier': 'log1p',
'field': 'population'
},
'weight': 3
9 years ago
}
],
'score_mode': 'first',
'boost_mode': 'replace',
'filter': {
'exists': {
'field': 'population'
}
}
}
}
]
}
}
}
},
'size': 20,
9 years ago
'track_scores': true,
'sort': [
'_score'
]
};