Julian Simioni
7a6ac8541b
Separate concerns of address parser
...
The address parser currently does two things:
1.) make some intelligent guesses as to possible admin regions to
explicitly search against to improve the quality of results returned
2.) make some intelligent guesses as to when no part of the query needs
to search against anything other than admin regions. This somewhat
improves the quality of results returned but mostly improves the speed
of the Elasticsearch query since it's searching significantly fewer
recoords.
These two concerns are now split into two separate methods within the
query_parser helper module. They are mostly independent today, but don't
have to be in the future.
9 years ago
Julian Simioni
9b94a0e4ef
Fix inconsistently named imported module
9 years ago
Julian Simioni
e71fb7cfd4
Whitespace
9 years ago
Harish Krishna
495c3251a4
moving all query parsing logic into its own helper. Tests to come
10 years ago
Harish Krishna
a8c090252a
if the query has a number - search addresses
10 years ago
Harish Krishna
346f187c3e
updateing isNumber regex
10 years ago
Harish Krishna
e1f3cfa0d3
no need to hit address parser if the input has just one token or two and no numbers
...
Ex: new, new york, minneapolis etc dont need address parsing but 'starbucks 10010' might need it
10 years ago
Harish Krishna
ebd4a5a08a
splitOnDelim first followed by a space tokenizer
10 years ago
Harish Krishna
a4d09f8e12
no address parsing required if there are only 2 or less tokens
10 years ago
Harish Krishna
bdffe758d4
commenting out the overkill
10 years ago
Harish Krishna
96a21570be
fixing layers related bug - adding a default_layers_set flag to clean obj.
10 years ago
Harish Krishna
042772cf3b
only do address parsing when necessary
10 years ago
Harish Krishna
1d24890b27
introducing target_layer that gets set part of input_parsing
...
- if input is less than 3 characters -> only hit admin layers
- if input suggests that its not a street address -> avoid hitting address layers
10 years ago
Harish Krishna
5accecfa6c
adding postcode support for usa
10 years ago
Harish Krishna
46cc1a6569
disabling parse-address
10 years ago
Harish Krishna
0b5b1dce85
address parser initial pass - breaks 68 tests! (ignoring tests for now)
10 years ago
Harish Krishna
176f580215
using is-object
10 years ago
Harish Krishna
d2d76be8fa
changing a commented line to reflect reality
10 years ago
Harish Krishna
a003b7b9bf
strip out leading and trailing whitespace if any
10 years ago
Harish Krishna
84a9b3e20e
splitting on comma (trying to find/assume admin values)
10 years ago
Harish Krishna
32275aca56
split sanitizers into reusable pieces. renaming sanitise to suggest. using suggest sanitizer for search. adding reverse sanitizer. updating tests..
10 years ago