[SERVER-20516] $text search with $language set to "none" miss some result Created: 21/Sep/15 Updated: 21/Sep/15 Resolved: 21/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.6.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | aunz | Assignee: | Stennie Steneker (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
A collection "test" with the following documents {name:"green apple"} {name:"red apple"} {name:"banana"}In the shell, running db.getCollection('test').find({$text:{$search:"banana",$language:"none"}}) But |
| Comments |
| Comment by Stennie Steneker (Inactive) [ 21/Sep/15 ] |
Hi, This is actually working as expected since you created the text index using the default stemming (language: "english") and are querying without any stemming (language: "none"). Text search uses the Snowball stemming algorithm, which stems your test words as:
You'll notice that "banana" does not change so would match in both cases, while "apple" requires the same stemming rule to be applied in the query in order to match what has been indexed. You can check some of the expected Snowball stemming using the online Snowball Demo or by finding a Snowball library for your preferred programming language. Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. If you have any follow-up questions on text search indexing, please post on the mongodb-user group. Thanks, |