Skip to content

How to make the msearch query case insensitive? #43

@yovthxx

Description

@yovthxx

Hello!

I am using msearch with sqlalchemy in my project and found out in testing that it is case sensitive. Is there a viable way to sort it out? I know to make a basic sqlalchemy query case insensitive using lower/upper, but I couldn't find a way to implement the same for your msearch syntax.

Please help :)

edit: Adding my queries as an example. First - search query that I would like to make case insensitive, second one is my solution to the same situation outside of msearch.

  1. posts = Posts.query.msearch(keyword, fields=['title', 'description', 'content'], limit=20).limit(10)
  2. user = Users.query.filter(func.lower(Users.username) == func.lower(username.data)).first()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions