How to fix MS Graph message body search?

旧巷老猫 提交于 2021-01-28 05:09:14

问题


Using graph explorer to execute the following message search by subject works as expected:

https://graph.microsoft.com/v1.0/me/messages?$search=%22subject%3Agoogle.com%3A443%2Fsearch%3Fq%3Da%2Btest*%22

However, this message search by body fails. The only difference between this and the previous search is that subject is replaced with body:

https://graph.microsoft.com/v1.0/me/messages?$search=%22body%3Agoogle.com%3A443%2Fsearch%3Fq%3Da%2Btest*%22

The error that I receive for the second search is "An internal server error occurred. The operation failed., Too few pops in query tree".

This search used to work. How do I fix it?


回答1:


This is a 500 error - you won't make this work. I'll report this as an error. The error appears to be with the second colon in the search string.

$search="body:google.com:443/search?q=a+test*" - this 500s

$search="body:google.com443/search?q=a+test*" - this 200s

Conjecture

I suspect that the search feature now supports multiple fields as the following query works as expected:

https://graph.microsoft.com/v1.0/me/messages?$search="body:Minerva subject:pilot"

This would break your query as it appears that the colon is only considered for specifying the field to search on.

Potential workaround

You could break your query string into multiple parts like this:

https://graph.microsoft.com/v1.0/me/messages?$search="body:google.com AND body:443/search?q=a+test*"

It is not sufficient but may work for your scenario.



来源:https://stackoverflow.com/questions/57225791/how-to-fix-ms-graph-message-body-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!