Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30726

inconsistent treatment of stopwords with language="none"

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Text Search
    • None
    • ALL
    • Query 2017-10-23, Query 2017-11-13, Query 2017-12-04

      I am using mongo db 3.2.8 on mac os. Here is a bug I'm facing when using language="none". My desired result was that when setting language="none", mongo DB will stop ignoring stopwords.

      I have created a collection 'resources' with text index on a field called 'title' with default language (English.)

      First, I create a document with title = 'What are you?'.

      1. When I search with db.getCollection('resources').find({$text:{$search: 'what are you?'}}) I get no results as expected because all the words are stopwords.
      2. When I search with
        db.getCollection('resources').find({$text:{$search: 'what are you?'}}, $language:"none"), I still get no results. Ideally, I'd like this to return the document.

      Now I modified the document to have title = 'Whats are you?' (notice the typo 'Whats')

      1. When I search with
        db.getCollection('resources').find({$text:{$search: 'whats are you?'}}, $language:"none"), I do not get this document even though there is an exact match and 'whats' is presumably not a stopword!
      2. When I search with
        db.getCollection('resources').find({$text:{$search: 'what are you?'}}, $language:"none"), I get this document in return!
      3. Language="en" is working fine: when I search with db.getCollection('resources').find({$text:{$search: 'whats are you?'}}) I get the result and when searching with db.getCollection('resources').find({$text:{$search: 'what are you?'}}), I don't.

            Assignee:
            kyle.suarez@mongodb.com Kyle Suarez
            Reporter:
            rajhans Rajhans Samdani
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: