
Hello, I have a large sneakers database, on which I'm performing full-text searches.
Single word queries work as expected.
Multi-word queries are quite strange:
When I search for Air Max
, Air Jordan 11
comes before Off-White Air Max 97
.
- I think InnoDB should return
Off-White Air Max 97
first as it contains a full-match, andAir Jordan 11
matches only the tokenAir
. But the Appwrite API returns everything matching with eitherAir
orMax
in a non-prioritized order. - Looking at the source code, I can see that Appwrite is using boolean mode for the search, but is also stripping all useful characters to perform operations (
+-@><...
). So, how can I perform aAND
full-text search? (Matching only names containingAir Max
)
Thanks

Can you try passing "Air Max"
as your search value?

Tried both "Air Max"
and 'Air Max'
, none of them make a difference

What exactly is your code?

Using the Dart SDK:
listDocuments(
databaseId: '...',
collectionId: '...',
queries: [
Query.limit(limit),
Query.offset(skip),
Query.search('indexed_search_term', "Air Max"), // Also tried "'Air Max'" and '"Air Max"'
]
);


Hmm let me test this when I'm at my desk later

so a network request with this:
queries[0]=search("search", "Air Max")
returns:

but like this:
queries[0]=search("search", "\"Air Max\"")
returns:

Oh great I'll try that during the day

It's working perfectly @Steven, thanks for your help.
I think it would really help to improve the doc regarding the full-text search, because most of the advanced behaviour are not described and we need to search through Discord / Github Issues / Source Code to have more info.
Especially for a AND
matching which I think is a quite common use-case.

improve the doc regarding the full-text search
In particular for search, we have this: https://github.com/appwrite/appwrite/discussions/5005#discussioncomment-4681079
Especially for a AND matching which I think is a quite common use-case.
What do you mean?

Yes that was the Issue I was refering. Could be great to have this info directly in the doc.
By AND
search I mean being able to search for results containing all the words, not one of the word.
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
