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.

125 lines
2.9 KiB

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