Searching Phone Number Issues in Typesense.
TLDR Robert was having issues searching phone numbers using Typesense. CaptainCodeman suggested storing the number as segments, while Jason clarified that Typesense only supports prefix queries and suggested workarounds.
1
1
Nov 09, 2021 (26 months ago)
Robert
07:18 PMid:string
, full_name:string
, phone_number:string
. I can search against full_name
very well (and unless otherwise specified, it will match queries against all of the properties.) However, unless I have something within 0-2 typos, it will never match a query against phone_number
. Any insight?Robert
07:19 PMphone_number
of +15553337895, and I tried to query against phone_number
with "7895", it would not match. it will only match if I have x5553337895 (for 1 typo), xx553337895 (for 2 typos).CaptainCodeman
08:52 PM1
Robert
09:05 PMJason
09:38 PM+1
, +15
, +1555
, etc will return <tel:+15553337895|+15553337895>
, but searching for a sub-string that is not the start of the string like 7895
(non-prefix) will not return that record.If you need to match sub-strings, I'd recommend breaking out the phone number into space separated sub-sections like
<tel:15553337895|1 555 333 7895>
or an array like CaptainCodeman mentions above. Or if you just need to search for last 4 digits, you could put just that in a separate field.Robert
10:51 PM1
Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Quick Retrieval of Min, Max, and Median Values from Search Query
Prajjval sought a more efficient way to find the min, max, and median values from a search query result. Jason suggested faceting. However, Prajjval clarified that faceting prolonged document upload due to a data type error, which was later resolved.
Issues Sorting Multiple Fields with Sort_by in Typesense Query
Rishabh was having trouble sorting two fields separately with a single query. Jason explained that a secondary sorting will only occur if the first sort results in matching values. They clarified the functionality of sorting in various search engines.
Sorting Results in Typesense and Handling Errors
Ramees asks about sorting results by distance in Typesense, entering a list of strings as a field, and resolving an error with `fields` format. Kishore Nallan assists with these issues and advises on storing timestamps and proper authentication.