Christian Fritzsche
05/20/2025, 10:46 AM$searchParameters = [
"q" => "leip*",
"query_by" => "seo_query",
"filter_by" => "main_entry:=true"
];
then 65 documents are found in my index, which is great.
But I want to use the filter to find cities. When I search like this:
$searchParameters = [
"q" => "*",
"query_by" => "seo_query",
"filter_by" => "seo_query:=leip* && main_entry:=true"
];
then there are no documents found. Why?Kishore Nallan
05/20/2025, 10:52 AMseo_query:leip*
Christian Fritzsche
05/20/2025, 11:32 AMChristian Fritzsche
05/20/2025, 11:33 AM['name' => 'seo_query', 'type' => 'string', 'facet' => true, 'sort' => true],
Kishore Nallan
05/20/2025, 11:56 AMHarpreet Sangar
05/20/2025, 2:39 PMseo_query
field that match with query_by
?Christian Fritzsche
05/20/2025, 2:45 PMChristian Fritzsche
05/20/2025, 2:47 PMHarpreet Sangar
05/20/2025, 2:48 PMHarpreet Sangar
05/20/2025, 3:11 PMHarpreet Sangar
05/20/2025, 3:25 PMfound: 15
Christian Fritzsche
05/20/2025, 4:18 PMChristian Fritzsche
05/20/2025, 4:19 PMcurl '<http://localhost:8108/multi_search>' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
{
"searches": [
{
"collection": "test",
"q": "*",
"filter_by": "seo_query: leip* && main_entry:=true"
}
]
}'
Christian Fritzsche
05/20/2025, 4:22 PMChristian Fritzsche
05/20/2025, 4:29 PMHarpreet Sangar
05/20/2025, 4:30 PMHarpreet Sangar
05/20/2025, 4:31 PMChristian Fritzsche
05/20/2025, 4:33 PMHarpreet Sangar
05/20/2025, 4:34 PMHarpreet Sangar
05/20/2025, 4:51 PMHarpreet Sangar
05/20/2025, 4:51 PM"out_of": 164,
is the same in your response?Christian Fritzsche
05/20/2025, 4:53 PM{
"results": [
{
"facet_counts": [],
"found": 0,
"hits": [],
"out_of": 164,
"page": 1,
"request_params": {
"collection_name": "geodb",
"first_q": "*",
"per_page": 10,
"q": "*"
},
"search_cutoff": false,
"search_time_ms": 17
}
]
}
Christian Fritzsche
05/20/2025, 4:54 PMHarpreet Sangar
05/20/2025, 4:56 PMseo_query
and main_entry
fields since we're only using those two in the query. I'll try again with all of the fields.Harpreet Sangar
05/20/2025, 5:00 PM"found": 64
Harpreet Sangar
05/20/2025, 5:04 PM"default_sorting_field":"label"
is causing the issue. When this is removed, "found": 64
is returned otherwise I get "found": 0
Christian Fritzsche
05/20/2025, 5:06 PMChristian Fritzsche
05/20/2025, 5:07 PMHarpreet Sangar
05/20/2025, 5:09 PM"found": 0
without "default_sorting_field":"label"
but mention that field in sort_by
Christian Fritzsche
05/20/2025, 5:11 PMcurl '<http://localhost:8108/multi_search>' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
{
"searches": [
{
"collection": "geodb",
"q": "*",
"filter_by": "seo_query: leip* && main_entry:=true",
"sort_by": "label:asc"
}
]
}'
Christian Fritzsche
05/20/2025, 5:11 PMChristian Fritzsche
05/20/2025, 5:12 PMHarpreet Sangar
05/20/2025, 5:17 PMChristian Fritzsche
05/20/2025, 5:22 PMChristian Fritzsche
05/21/2025, 8:09 AMcurl '<http://localhost:8108/multi_search?query_by=seo_query>' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
{
"searches": [
{
"collection": "geodb",
"q": "leip*",
"filter_by": "main_entry:=true",
"sort_by": "label:asc"
}
]
}'
But when I use the wildcard in the filter, I only get 64 results ('leipheim' is missing):
curl '<http://localhost:8108/multi_search>' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
{
"searches": [
{
"collection": "geodb",
"q": "*",
"filter_by": "seo_query: leip* && main_entry:=true",
"sort_by": "label:asc"
}
]
}'
Can you help me to understand the difference?Harpreet Sangar
05/21/2025, 9:37 AM-
as token_separators
in the schema. Also, increasing the number of max_filter_by_candidates
will return more results.Christian Fritzsche
05/21/2025, 1:34 PM