0

I have a document library called Documents. But trying to use the search rest api like so

https://xxx/_api/search/query?querytext=%27Bomb+path:"https://xxx/Documents"%27&selectproperties='Department,Description'

I can see the fields Department and Description fields return values. Currently i'm just pasting the URL above in a web browser. But i can't see Categories and Policy Number. I have tried using the field internal name but no luck :(

Category- Choice Field Description :- Multiple lines of text Category :- Choice Policy Number - Single line of text

Thanks i Advance

1 Answer 1

3

selectproperties is used to retrieve values of managed properties. So you need add these columns as managed properties to the search schema (in Search Service Application / Central Admin) with Retrievable flag is checked.

SharePoint 2013 Search REST API:

selectproperties

Specifies the list of managed properties to return for each search result item. For a managed property to be returned; the Retrievable flag must be set to "true" in the Search Schema.

UPD:

Search for existed properties before.

In my env choice field DocumentAttr has managed property - DocumentAttrOWSCHCS and text field RegulDocNumb - RegulDocNumbOWSTEXT

4
  • Thanks. I just checked it and it has the Retrievable property checked Commented Jun 25, 2018 at 7:47
  • So with selectproperties='Title,DocumentAttrOWSCHCS,Created' I can retrieve DocumentAttr value in the search query result. Commented Jun 25, 2018 at 11:45
  • Thanks. I have a filed called categories(choice field) and when i try retrieving Categories0OWSHHCS as the manage property . I can't see to return the values. see below returning null - <d:element m:type="SP.KeyValue"> <d:Key>Categories0OWSCHCS</d:Key> <d:Value m:null="true" /> <d:ValueType>Null</d:ValueType> </d:element> Commented Jun 26, 2018 at 7:16
  • Why it cannot be null? Commented Jun 26, 2018 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.