Hey guys. Is it true that we cannot do simple "non...
# community-help
g
Hey guys. Is it true that we cannot do simple "non-exact" filtering with nested fields? My schema:
Copy code
{
  "created_at": 1740508304,
  "default_sorting_field": "",
  "enable_nested_fields": true,
  "fields": [
     .....
    {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "phones",
      "optional": true,
      "sort": false,
      "stem": false,
      "stem_dictionary": "",
      "store": true,
      "type": "object[]"
    },
    {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "phones.phone",
      "optional": true,
      "sort": false,
      "stem": false,
      "stem_dictionary": "",
      "store": true,
      "type": "string[]"
    },
    ...
  ],
  "name": "users",
}
And I'm trying to:
filter_by: phones.phone:131
which doesn't work, but...
filter_by: phones.phone:=<the_full_number>
does work
j
filter_by is designed to be an exact match
And recently we added "starts with" support in filter_by
If you need more loser matches, then you want to use the
q
parameter
Here's a detailed article on the topic of searching for phone numbers: https://typesense.org/docs/guide/tips-for-searching-common-types-of-data.html#phone-numbers
g
Got it. I always thought about the non-exact filtering as equivalent to
q
, but now I got the difference. I guess using "starts with" will help us in this case. Thank you!