Planning to move Atlas search

Hi.
i am planning to move Atlas search but need to confirm something before moving from
Elastic Search if we search like i.e. " Apple AND Banana " then it will return all doc containing all doc Which has both Banana and Apple,
“Apple AND Mango NOT BANANA” return Doc containig apple and mongo but not banana. in Elastic we just put these string and we are done. we don’t need to worry about to process string.

Do we have same in atlas search to handle these type of boolean operation written in input string without explicitly spliting string or processing search string to get boolean operation ??

It sounds like you are referring to the queryString operator. The compound operator offers similar capabilities that are more flexible, but either will work.

For compound, must = AND, should = OR, and mustNot = AND NOT.

I hope this help.

1 Like

Hey Marcus,
Thank you for your response… And it’s gonna help me a lot

Hey,
I tried this queryString but i get only Blank list. even i didn’t get any error
I don’t know why i’m getting blank list every time.

I used this syntax in python
results=collection.aggregate([ {

         "$search": {

            "queryString": {

            "defaultPath": "Company name",

            "query":"(pharma AND Medication)",

         }

        }

        },

            {

            "$project": {

             "Company name":1,

            "content": 1

       

            }

        }

        ])

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.