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.

129 lines
3.4 KiB

module.exports = {
'query': {
'filtered': {
'query': {
'bool': {
9 years ago
'must': [
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'boost': 1,
'query': 'test'
}
}
}
9 years ago
],
'should': [
{
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 2,
'query': 'test'
}
9 years ago
}
},
{
'function_score': {
'query': {
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 2,
'query': 'test'
}
}
9 years ago
},
'functions': [
{
9 years ago
'weight': 2,
'linear': {
'center_point': {
'origin': {
'lat': 29.49136,
'lon': -82.50622
},
'offset': '1km',
'scale': '50km',
9 years ago
'decay': 0.5
}
}
9 years ago
}
],
'score_mode': 'avg',
'boost_mode': 'replace'
}
},
{
'function_score': {
'query': {
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 2,
'query': 'test'
}
9 years ago
}
},
'max_boost': 20,
'functions': [
{
9 years ago
'field_value_factor': {
'modifier': 'log1p',
'field': 'popularity',
'missing': 1
9 years ago
},
'weight': 1
}
],
'score_mode': 'first',
'boost_mode': 'replace'
9 years ago
}
},
{
'function_score': {
'query': {
'match': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 2,
'query': 'test'
}
}
},
9 years ago
'max_boost': 20,
'functions': [
{
'field_value_factor': {
'modifier': 'log1p',
'field': 'population',
'missing': 1
9 years ago
},
'weight': 2
}
],
'score_mode': 'first',
'boost_mode': 'replace'
9 years ago
}
}
9 years ago
]
}
}
}
},
'size': 10,
9 years ago
'track_scores': true,
'sort': [
'_score'
]
};