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.

161 lines
3.5 KiB

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