SharePoint Online Provider Hosted - No Search Results

2022-01-05T14:16:26.577+00:00

Hi I'm having trouble with my provider hosted app.

I've created an app which mostly works, but the search whilst I could have sworn was working now gives me no results.

My code is thus.

KeywordQuery keywordQuery = new KeywordQuery(_sp);
 keywordQuery.QueryText = "Test*"

 keywordQuery.StartRow = 0;

SearchExecutor searchExecutor = new SearchExecutor(_sp);

ClientResult<ResultTableCollection> results = searchExecutor.ExecuteQuery(keywordQuery);
 _sp.ExecuteQuery();

and it all works and compiles, but no results. The site works fine, if I try the REST API though a test tool and Postman, that works fine. But this does not.

Any ideas on how to fix this?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,632 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,902 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 34,821 Reputation points Microsoft Vendor
    2022-01-06T02:04:07.663+00:00

    Hi @Housham Richard - Systems Developer ,
    Please check the permission of the user to the results. Then this could be some rows / items are incorrectly treated as duplicates by search.

    Try to add keywordQuery.TrimDuplicates = false; in your code, check if it works for you.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. 2022-02-15T09:16:18.733+00:00

    Ok, long story short there is a problem in creating a site app categlog for a ste collection.
    https://www.c-sharpcorner.com/article/enable-site-collection-app-catalog-for-particular-site-collection-level-solution/

    This seems to create some problems with duplicate fields and then knackers up a few fields - by creating duplicates (just what our systems team told me). This then knackers up calculated fields form page and this search tool.

    Deleting the fields solves the problem.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.