Support full Lucene Query Parser syntax in $search
I’m looking to expose “power user” queries through our UI, but the queryString operator only works on string data types, and is somewhat too simplistic for this purpose.
Obviously, accepting raw user inputs and directly building a query from it is a security risk, but using something like queryString (which I do currently) seems like a safer and/or easier option.
I would like to see a new $search operator (perhaps "lucene" or "query") that accepts the full Lucene Query Parser Syntax.
![](https://secure.gravatar.com/avatar/cc7fe4733738837adb6f8b7e29686a1c?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Yi Wang commented
Our use case specifically needs the queryString query to support wildcard `?*` and fuzzy search `~` as Lucene does.
https://www.mongodb.com/community/forums/t/does-querystring-query-support-wildcard-and-fuzzy-search/180296