Browse Source

add ciao test for confidence and match_type properties

pull/674/head
Diana Shkolnikov 8 years ago
parent
commit
4a7dee235a
  1. 3
      test/ciao/search/address_parsing.coffee
  2. 80
      test/ciao_test_data.js

3
test/ciao/search/address_parsing.coffee

@ -39,3 +39,6 @@ json.geocoding.query.parsed_text['street'].should.eql 'w 26th st'
json.geocoding.query.parsed_text['state'].should.eql 'NY'
json.geocoding.query.parsed_text['regions'].should.eql []
json.geocoding.query.parsed_text['admin_parts'].should.eql "ny"
json.features[0].properties.confidence.should.eql 1
json.features[0].properties.match_type.should.eql "exact"

80
test/ciao_test_data.js

@ -48,6 +48,86 @@ types.forEach( function( type, i1 ){
});
});
client.index(
{
index: config.indexName,
type: 'address',
id: 'way:265038872',
body: {
'center_point': {
'lon': -73.990425,
'lat': 40.744131
},
'parent': {
'country': [
'United States'
],
'neighbourhood_id': [
'85869245'
],
'country_a': [
'USA'
],
'locality_a': [
null
],
'region_id': [
'85688543'
],
'county': [
'New York County'
],
'borough_a': [
null
],
'borough_id': [
'421205771'
],
'locality': [
'New York'
],
'borough': [
'Manhattan'
],
'region_a': [
'NY'
],
'county_id': [
'102081863'
],
'locality_id': [
'85977539'
],
'neighbourhood_a': [
null
],
'neighbourhood': [
'Flatiron District'
],
'region': [
'New York'
],
'country_id': [
'85633793'
],
'county_a': [
null
]
},
'name': {'default': '30 West 26th Street'},
'address_parts': {
'zip': '10010',
'number': '30',
'street': 'West 26th Street'
},
'alpha3': 'USA',
'source': 'openstreetmap',
'source_id': 'way:265038872',
'layer': 'address'
}
}
);
// call refresh so the index merges the changes
actions.push( function( done ){
client.indices.refresh( { index: config.indexName }, done);

Loading…
Cancel
Save