[SOLVED] how to do `search` in a string and `greaterThanEqual` in a datetime, in one query
- 0
- Databases
- Web

as the title suggests, I'm in a situation, where I need to do a search
query on a string-type array, but that query also includes a DateTime attribute. if I go into detail, I need to do a search
on a String[]
, and a greaterThanEqual
on a DateTime
attribute, in a single query. And as we all know, the search
query requires a FullText
type index. I tried creating a FullText
index with DateTime
attribute included, but the creation fails (as expected).
I made a post about this previously, and there, someone mentioned that I cannot create a FullText
index with types other than string. I lost that post, so here I'm posting it again. Is there any workaround to accomplish this?

Hi

hello

Let me look into this and brb

So,

You can create 2 indexes for this to work separately. If your app does not do very much heavy lifting, this shouldnt impact the performance by a lot. MariaDB should be smart enough and always look for the best possible option. Separate indexes are still faster than no indexes, so it should be used under the hood.

If you want to get rid of "index not found" error, it's fine to leave it as it. Create index, it will be failed, ignore it.

For someone in future checking this post and didn't get what actually to do: so I created one FullText
index with the attr that I wanna do search
query. one key
index with the DateTime attribute. it does the job. but still returns "Index not found". to tackle that, I created a dummy FullText
index with both attr included (tho the creation failed, but it resolved the "Index not found" error)
Thanks @joeyouss

[SOLVED] how to do search
in a string and greaterThanEqual
in a datetime, in one query

Thank you @manazo ❤️ this msg is helpful
Recommended threads
- mcp-for-docs not working properly
I'm experiencing issues integrating the MCP server tool with Cursor IDE. The MCP server connection establishes successfully initially but fails after one minute...
- 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-...
