Browse Source

fixed tests for latest query changes

pull/668/head
Stephen Hess 8 years ago
parent
commit
cf1aeec4e1
  1. 96
      test/unit/fixture/search_fallback.js

96
test/unit/fixture/search_fallback.js

@ -109,10 +109,97 @@ module.exports = {
'address_parts.street': 'street value' 'address_parts.street': 'street value'
} }
}, },
{
'multi_match': {
'query': 'neighbourhood value',
'type': 'phrase',
'fields': [
'parent.neighbourhood',
'parent.neighbourhood_a'
]
}
},
{
'multi_match': {
'query': 'borough value',
'type': 'phrase',
'fields': [
'parent.borough',
'parent.borough_a'
]
}
},
{
'multi_match': {
'query': 'city value',
'type': 'phrase',
'fields': [
'parent.locality',
'parent.locality_a',
'parent.localadmin',
'parent.localadmin_a'
]
}
},
{
'multi_match': {
'query': 'county value',
'type': 'phrase',
'fields': [
'parent.county',
'parent.county_a',
'parent.macrocounty',
'parent.macrocounty_a'
]
}
},
{
'multi_match': {
'query': 'state value',
'type': 'phrase',
'fields': [
'parent.region',
'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
]
}
},
{
'multi_match': {
'query': 'country value',
'type': 'phrase',
'fields': [
'parent.country',
'parent.country_a',
'parent.dependency',
'parent.dependency_a'
]
}
}
],
'should': [
{ {
'match_phrase': { 'match_phrase': {
'address_parts.zip': 'postalcode value' 'address_parts.zip': 'postalcode value'
} }
}
],
'filter': {
'term': {
'layer': 'address'
}
}
}
},
{
'bool': {
'_name': 'fallback.street',
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}, },
{ {
'multi_match': { 'multi_match': {
@ -183,9 +270,16 @@ module.exports = {
} }
} }
], ],
'should': [
{
'match_phrase': {
'address_parts.zip': 'postalcode value'
}
}
],
'filter': { 'filter': {
'term': { 'term': {
'layer': 'address' 'layer': 'street'
} }
} }
} }

Loading…
Cancel
Save