hello, I trying typesense as search solution to my...
# community-help
r
hello, I trying typesense as search solution to my APP. I'm searching by locations address and I did this search: q=maria&query_by=address And I got this results:
Copy code
"highlights": [
        {
          "field": "address",
          "matched_tokens": [
            "Maria"
          ],
          "snippet": "Praça Dona Maria II 1714, Portugal"
        }
      ],

"highlights": [
        {
          "field": "address",
          "matched_tokens": [
            "Carvalho"
          ],
          "snippet": "R. José Carvalho Sá Miranda 44, Portugal"
        }
      ],
The first result is correct, but the second is completely wrong. I have more wrong results like that. Why? What i'm doing wrong?! I dont have any synonyms.
k
Hi Rolando. Can you please tell me what version of Typesense you are using?
r
v0.20.0 I'm trying on self-hosted and cloud.typesense.org
k
I think the issue might be simply because the word
Carvalho
is within typo distance of 2 from
Maria
if you are making a prefix search because
Carva
is compared with
Maria
(replace C with M and V with I). There are two options. You can try setting
num_typos
to 1, or you can try setting
typo_tokens_threshold
parameter to 1.
Having said that, we've also fixed a few issues with typo correction on the pre-release builds. Can you please try it on
typesense/typesense:0.21.0.rc20
Docker image locally once?
r
with update to 0.21 it was even worse.. with 0.21 +
typo_tokens_threshold
was a little better, at least Carvalho is desapear with the
num_typos
the results are OK.
k
Can you give me an example where it does not work with 0.21 +
typo_tokens_threshold=1
?
r
same query got this result:
Copy code
"highlights": [
        {
          "field": "address",
          "matched_tokens": [
            "Mal."
          ],
          "snippet": "Av. Mal. Humberto Delgado 206, 4760-012 Vila Nova de Famalicão, Portugal"
        }
      ],
with
num_typos
i got the right number of results
k
Thanks for the example. It is just the way fuzzy prefix matching works on single word queries. First 3 letters of "mal" and "maria" are considered, and they tend to match. If you remove prefix searching option, it won't match even with num_typos:2
r
More examples 😄 same query + 0.21.0.rc20 + num_typos:2 + prefix=false got this:
Copy code
"highlights": [
        {
          "field": "name",
          "matched_tokens": [
            "Bar"
          ],
          "snippet": "PRÍNCIPE - Restaurante e Snack Bar"
        }
      ],
k
This is something for me to investigate. I will take a look.
r
same query + 0.20.0 + num_typos:2 + prefix=false Right results
👍 1
k
@Rolando Guedes Can you please try against this Docker build:
typesense/typesense:0.21.0.rc21