Question

I want to retrieve all the library items of a content type "Prod Request". I am using REST API for this. I am not able to get lookup column values.In below query my lookup column name is LookUp1. I am getting all column values except LookUp1. I mapped LookUp1 column to managed properties and ran a full crawl also but no use. Is there a different way for doing it in search api? Here is my query...... Please assist.

$.ajax({             
    url: https://mysite.domain.com/_api/search/query?querytext='contenttype:Prod Request'&rowlimit=100&trimduplicates=false&selectproperties='Title,LookUp1',
    method: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" 
},
    success: function (data) {...........

Some more info... lookup column managed property is added at Site Collection administration level not at central admin level. Full CRAWL is also performed... I also tried modifying $expand my lookup column like below

url: "https://mysite.domain.com/_api/search/query?querytext='contenttype:Prod Request'&rowlimit=100&trimduplicates=false&selectproperties='Title,LookUp1/Title'&$expand=LookUp1",

but it didnt work

Était-ce utile?

La solution

Please check the points below:

  1. Create the managed property in search service application level instead of site collection level. Delete site collection level property, then start a full crawl
  2. Make sure the managed property is searchable, queryable and retrievable.
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top