Is this supposed to match 1-1193 and 11193? I was ...
# community-help
a
Is this supposed to match 1-1193 and 11193? I was using it as an exact match, but both are matched. { "q": "*", "query_by": "spec. number", "filter_by": "spec. number:=`1-1193`", "page": 1, "per_page": 2, "exhaustive_search": true }
k
Copy code
"filter_by": "spec. number:=`1-1193`",
This is not a valid syntax. For range you can do:
Copy code
"filter_by": "spec.number:=[1..1193]"
Where did you find the earlier syntax?
a
hehe it's a string 🙂
Not a range
so
a-a
is matched as well as
aa
in exact matching?
k
Got it. But we don't support that filtering syntax.
Oh wait
Ideally
-
will get dropped unless it's configured as a symbol to be indexed, so yes
1-1193
and
11193
are the same but only without the surrounding backticks.
a
So I should retry without the backticks?
k
Copy code
spec.number:=1-1193
is equal to
Copy code
spec.number:=11193
I think. I'm not sure if the presence of
:=
will also affect the
-
from being dropped.
a
Is it possible to not drop the - ?
k
Why is there a space after
spec.
?
a
That's the field name, no particular reason
It's simply what I've been given
k
You can also try without the
=
Copy code
spec.number: 1-1193
a
Still two results
k
But this would match substrings. If the identifiers are fixed length it won't matter.
a
Yea, I switched from
:
to
:=
expecting I could make it exact. Is it possible to not drop the - ?
k
Ok for further investigation, can you please create a bug report with a small reproducible example? Details here: https://github.com/typesense/typesense/issues/new?template=bug_report.md
a
Of course I will
Do you think it's a bug?
k
Need to see a small reproducible example to confirm.
a
Okay, but are we clear on what the idea is? I am trying an exact filtering for
a-a
, but also get
aa
Can I also index the
-
before opening an issue for you?
k
Yes check symbols_to_index parameter. This did have a bug related to filtering though. It has been fixed in latest v29 RC build.
🥰 1
a
Before creating duplicate issues for you, I tested some more. I used the newest RC build and symbols_to_index at the collection root level. This is already fixed and works with that configuration.
k
Ok great, thanks for confirming.
💪🏻 1