Skip to content

Commit

Permalink
feat: Use peliasQuery analyzer for address_parts.street
Browse files Browse the repository at this point in the history
This is an experimental change, but one that has good impact when paired
with pelias/schema#446.

Essentially, this change continues the trend we have started for the
`name.*` and `phrase.*` fields to generate synonyms _only_ at index
time.

It may be the case that variations on input vs data text (for example
`crt` vs `ct` vs `court`) may cause different synonyms to be generated
by the same analyzer.

Many queries, especially `match_phrase` queries, will require that _all_
of those generated synonym tokens must match. This is often not
desirable.
  • Loading branch information
orangejulius committed Jun 25, 2020
1 parent e059815 commit 870c7be
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions query/autocomplete_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'address:housenumber:boost': 2,
'address:housenumber:cutoff_frequency': 0.01,

'address:street:analyzer': 'peliasStreet',
'address:street:analyzer': 'peliasQuery',
'address:street:field': 'address_parts.street',
'address:street:boost': 1,
'address:street:cutoff_frequency': 0.01,

'address:cross_street:analyzer': 'peliasStreet',
'address:cross_street:analyzer': 'peliasQuery',
'address:cross_street:field': 'address_parts.cross_street',
'address:cross_street:boost': 5,
'address:cross_street:cutoff_frequency': 0.01,
Expand Down
2 changes: 1 addition & 1 deletion query/search_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'address:housenumber:boost': 2,
'address:housenumber:cutoff_frequency': 0.01,

'address:street:analyzer': 'peliasStreet',
'address:street:analyzer': 'peliasQuery',
'address:street:field': 'address_parts.street',
'address:street:boost': 5,
'address:street:slop': 1,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/autocomplete_single_character_street.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
'query': 'k road',
'cutoff_frequency': 0.01,
'boost': 1,
'analyzer': 'peliasStreet'
'analyzer': 'peliasQuery'
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_boundary_country.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_boundary_country_multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_boundary_gid.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/fixture/search_fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down Expand Up @@ -278,7 +278,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_bbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_focus_bbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_focus_null_island.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_linguistic_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_with_category_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/fixture/search_with_source_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'match_phrase': {
'address_parts.street': {
'query': 'street value',
'analyzer': 'peliasStreet',
'analyzer': 'peliasQuery',
'slop': 1
}
}
Expand Down

0 comments on commit 870c7be

Please sign in to comment.