We have Alias street name and Street name in our couchbase database. i want to find streetname using postal code and Alias street name.
SELECT streetname from ‘database’ where alias_streetname = “CALLE FCO POLANCO” AND postalcode =“00617”
Is there any way to allow fuzziness of 2 in above N1QL query on alias_streetname ?
I want to give fuzziness of 2 on alias Street name so that my where condition satisfy with two character mistake. In full text search we can set fuzziness but how can we do this using N1QL
N1QL keyword matching. If you need wildcards use LIKE.
I’m assuming that you want to find data where the streetname might be slightly misspelled? E.g. it might be “CALE FCO POLANCO” or “CALL FCO POLANCO”?
What you probably need for this kind of query is to use Full Text Search, which is more language aware and can handle fuzziness. If you decide to try LIKE, you’re going to run into a whole bunch of edge cases.
There is no N1QL function for levenshtein distance (yet) as far as I know. A full text search can do fuzzy matching and exact matching.
Also, if you want to use both together, as of Couchbase Server 6.5 (currently in beta), you can call Full Text Search (FTS) indexes from N1QL queries.