问题
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