質問

I want to get all the peoples whose PreferredName contains "Tar".

I have written a search query for this search

/_api/search/query?querytext='*'&selectproperties='PreferredName,OriginalPath,WorkEmail,SipAddress,Department,Path,PictureURL,JobTitle,AccountName,BaseOfficeLocation,'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&refinementfilters='substringof("Tar", PreferredName)'

but it shows an error message "Bad Request" and tells refinementFilter is invalid. what is the error in this query??

役に立ちましたか?

解決

You can use it as below:

/_api/search/query?querytext='*'&selectproperties='PreferredName,OriginalPath,WorkEmail,SipAddress,Department,Path,PictureURL,JobTitle,AccountName,BaseOfficeLocation,'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&refinementfilters='PreferredName:("Tar*")'

looks like substring or contains is not supported in refinement filters

他のヒント

You can use filter=substringof('Tar', PreferredName) to find names containing the string "Tar".

Your query will be:

/_api/search/query?querytext='*'&selectproperties='PreferredName,OriginalPath,WorkEmail,SipAddress,Department,Path,PictureURL,JobTitle,AccountName,BaseOfficeLocation,'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&filter='substringof("Tar", PreferredName)'

Read More: Filter Expressions

You can try using "tar"

/_api/search/query?querytext='*'&selectproperties='PreferredName,OriginalPath,WorkEmail,SipAddress,Department,Path,PictureURL,JobTitle,AccountName,BaseOfficeLocation,'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&refinementfilters='PreferredName:("*Tar*")'

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top