[SERVER-10227] Add regex support to FTS command/queries Created: 16/Jul/13 Updated: 28/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Text Search |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Ryan Nitz | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | qi-text-search | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query Integration
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
It would be very useful for querying FTS indexes to support regular expressions in the "search" field/parameter. If you are indexing and querying non-standard/language text content, there are use cases where you would want to know about substrings. Using the example content below, it would be nice to be able to say:
Example Content |
| Comments |
| Comment by J Rassi [ 12/Aug/14 ] | ||
|
Linking dup The solution Eliot proposes above is clunky in that it requires the user writing the query to know what fields are being indexed. My personal refinement of this feature request would be to support some mechanism to allow users to specify an additional predicate that would be applied to all text-index fields (which would filter for documents that have at least one text-indexed field that passes the predicate). To illustrate: suppose a user has defined an index {a: "text", b: "text", c: "text"}. In today's query language, to perform the operation that Ryan poses as "firstTest18 AND -someText AND /.*Wrong22$/", the user constructs the following query:
Perhaps a $text sub-operator (perhaps called something like $match) could be introduced such that the following is equivalent to the above:
| ||
| Comment by Eliot Horowitz (Inactive) [ 17/Jul/13 ] | ||
|
What does using a filter in the command not work? db.foo.runCommand( "text" , { search : "firstTest18 -someText", filter : { something : /.*Wrong22$/ }} ) |