I am using below code to get a component list from particular folder based on a particular schema.
SearchQueryData queryData = new SearchQueryData
{
BasedOnSchemas = new BasedOnSchemaData[]
{
new BasedOnSchemaData()
{
Schema = new LinkToSchemaData {IdRef = schemaId}
}
},
SearchIn = new LinkToIdentifiableObjectData { IdRef = folderId },
ItemTypes = new ItemType[] { ItemType.Component }
};
IdentifiableObjectData[] compList = _client.GetSearchResults(queryData);
It is working fine for most of the folders. But for few folders it is not working properly. [No Error Message is there. Only count of the component is 0].
I have already compared the folder properties, and there is no mismatch. Also found that the issue is happening for newly created folders only.
Do you have any clue ? Please suggest. [FYI: I am Using 2013 SP1]