The second example is closer, but you need to adjust it a bit. If you need to exclude ANY of the second group of keywords, you should group them together via AND statements. Using OR will return results where only one of those is missing. And if you do it without grouping like in the first example, you need to group the first set of keywords.
Content Search Query
Need to search for keywords in Office 365 content search, please help with the query...i need to find emails with certain keywords but it shouldn't have few keywords like
Should be present
Crown
King Crown
King Street 12
Should not be present
Queen
Street Dancer
RET 26
Is the below query correct under keyword search? Please advice with the correct one.
Crown OR King Crown OR King Street 12 NOT Queen NOT Street Dancer NOT Ret 26
2 answers
Sort by: Most helpful
-
-
Lucas Liu-MSFT 6,176 Reputation points
2020-09-24T05:53:03.593+00:00 Hi @Karun Khanna ,
Your second plan is better, it should be noted that if you use "OR" to connect the second group of keywords, as long as the email contains any keyword, it will not be displayed in the results. If you use the "AND" connection, then only if the email contains all keywords at the same time, it will not be displayed in the results. As my test results, if an email contains both keywords that need to exist and keywords that do not need to exist, the email will not appear in the search results.
The screenshot below is test in my lab environment, tested the results returned by using "OR" and "AND" to connect the second set of keywords, which hope can help you understand better.
The mail in my mailbox.
Using "OR"
Using "AND"
----------
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.