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

inconsistent treatment of stopwords with language="none"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Text Search
    • Labels:
      None
    • Operating System:
      ALL
    • Sprint:
      Query 2017-10-23, Query 2017-11-13, Query 2017-12-04

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: