[SERVER-10413] mongodb Text Search with wild card Created: 02/Aug/13  Updated: 28/Dec/23

Status: Backlog
Project: Core Server
Component/s: Text Search
Affects Version/s: 2.4.5
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: nirav Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 18
Labels: qi-text-search
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-10227 Add regex support to FTS command/queries Backlog
Assigned Teams:
Query Integration
Participants:

 Description   

Is test search missing capability of utilizing wild cards(*, ?) in "text' command.
I couldn't do following:
db.col_name.runCommand( "text",

{ search: "\"the*hartford\"" }

)
to retrieve: the-hartford, the hartford, the xyz-abc hartford etc..



 Comments   
Comment by nirav [ 14/Aug/13 ]

Thanks for making it "feature request". Problem with using regular expression is that it's very slow for us as we have so many search terms which starts with wildcard characters.

Comment by J Rassi [ 12/Aug/13 ]

You can use dot (the "wildcard" character) in a regular expression predicate, e.g. db.collection.find({field:/the.*hartford/}), but not in a text search string. When querying a text index, your such string must include a list of terms and/or exact phrases. You can specify a regular expression predicate as an additional filter to a text search, e.g db.collection.runCommand("text",{search:"hartford",filter:{field:/the.*hartford/)}}, but note that the filter will not use the text index.

I converted the type of this ticket to a feature request.

Generated at Thu Feb 08 03:23:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.