mirror of https://github.com/pelias/api.git
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.
109 lines
3.1 KiB
109 lines
3.1 KiB
|
|
var peliasQuery = require('pelias-query'), |
|
vs = new peliasQuery.Vars( peliasQuery.defaults ); |
|
|
|
module.exports = { |
|
'query': { |
|
'filtered': { |
|
'query': { |
|
'bool': { |
|
'must': [{ |
|
'match': { |
|
'name.default': { |
|
'query': '1 water st', |
|
'analyzer': 'peliasOneEdgeGram', |
|
'boost': 1 |
|
} |
|
} |
|
}], |
|
'should': [{ |
|
'match': { |
|
'phrase.default': { |
|
'query': '1 water st', |
|
'analyzer': 'peliasPhrase', |
|
'type': 'phrase', |
|
'slop': 2, |
|
'boost': 1 |
|
} |
|
} |
|
},{ |
|
'match': { |
|
'address.number': { |
|
'query': 1, |
|
'boost': vs.var('address:housenumber:boost').get(), |
|
'analyzer': vs.var('address:housenumber:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'address.street': { |
|
'query': 'water st', |
|
'boost': vs.var('address:street:boost').get(), |
|
'analyzer': vs.var('address:street:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'admin0': { |
|
'query': 'manhattan', |
|
'boost': vs.var('admin:admin0:boost').get(), |
|
'analyzer': vs.var('admin:admin0:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'admin1': { |
|
'query': 'manhattan', |
|
'boost': vs.var('admin:admin1:boost').get(), |
|
'analyzer': vs.var('admin:admin1:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'admin1_abbr': { |
|
'query': 'NY', |
|
'boost': vs.var('admin:admin1_abbr:boost').get(), |
|
'analyzer': vs.var('admin:admin1_abbr:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'admin2': { |
|
'query': 'manhattan', |
|
'boost': vs.var('admin:admin2:boost').get(), |
|
'analyzer': vs.var('admin:admin2:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'local_admin': { |
|
'query': 'manhattan', |
|
'boost': vs.var('admin:local_admin:boost').get(), |
|
'analyzer': vs.var('admin:local_admin:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'locality': { |
|
'query': 'manhattan', |
|
'boost': vs.var('admin:locality:boost').get(), |
|
'analyzer': vs.var('admin:locality:analyzer').get() |
|
} |
|
} |
|
}, { |
|
'match': { |
|
'neighborhood': { |
|
'query': 'manhattan', |
|
'boost': vs.var('admin:neighborhood:boost').get(), |
|
'analyzer': vs.var('admin:neighborhood:analyzer').get() |
|
} |
|
} |
|
}] |
|
} |
|
} |
|
} |
|
}, |
|
'size': 10, |
|
'sort': [ '_score' ], |
|
'track_scores': true |
|
}; |