4

I have simple search REST GET query as below :

https://<site url>/_api/search/query?querytext='research'&selectproperties='Title,Author,Created,ContentTypeId'

The search result XML returned is like below : enter image description here

But the 'Author' field is returned with a value null.

What could be a possible reason?

  • What shows up if you manually search for for these articles in the UI -- specifically when you mouse over these objects what is in the "Contributors Include" area? If there is no author on whatever it is you're looking at, that could be a reason it's showing up null. Everything in my environment seems to have something for the author though, even if it's just 'System Account' – John-M Nov 20 '14 at 15:32
  • Lookups need to be expanded. You can not simply select Author. – Nils May 14 at 21:37
1

Make sure the internal name of the fields matches the field name you are using in your request. I've created an author field for a list doing something similar and the internal name defaulted to Author0 as Author already existed.

And if it is a lookup field you are using you'll have to use something like Author/Name&$expand=Author/Name in your request.

  • The 'Author' field in my case is the internal name of default SharePoint field whose display name is 'Created By' – Bishnu D. Nov 4 '14 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.