Forum Discussion

Mike Jansen's avatar
Mike Jansen
Iron Contributor
Mar 24, 2017

Sharepoint rest api search - Lookup field issue

I have this query:

 

https://blabla.sharepoint.com/_api/search/query?querytext='ContentType:PROJ_hours'&selectproperties='PROJSearchName%2cPROJSearchcode%2cPROJSearchDescr'

This should return:

Names

Hour Codes

Hour Code description

 

When I enter a new "PROJ_hours" in a list I select a name and an Hour code. The Hour Code is a lookup to another list. I have configured this that the description of this Hour Code is also returned to the list. Working fine.

 

I have created managed properties from the crawled properties for all three fields.

 

Somehow this Hour Code Description does return "null" Configured this more than a week ago so full crawl has been done and also entered new values in the list.

 

Now I have two approaches:

1. Get this working as it should be ;-) Should I use the $expand option? But how do I use it in a querytext string?

 

2. First fire the query above to get the "hour code" and then, for each record, fire a query on the Hour code list to read the description.

 

3. Fire a second query to get the whole "hour code" list and join the two.

 

Allthough the second option is not a nice one, will this be very consuming? Doe this really slow down my application?

 

Thanks, Mike

No RepliesBe the first to reply

Resources