‎SharePoint Onpremise Search results not coming‎

Sayantan Ganguly 80 Reputation points
2023-11-14T10:58:44.8566667+00:00

I am trying to get all of the pages from SharePoint using the below API:

https://one.dtcc.com/_api/search/query?querytext='IsDocument:1 AND FileExtension:aspx'

I am getting approx 1000 pages from the results which is perferctly fine.

But I have approx 1700 pages which is not coming. So, I have checked using different search api why it is not coming using below api:

https://one.dtcc.com/_api/search/query?querytext='Path:https://one.dtcc.com/news-and-events/employee-news/the-view/Pages/Amy-Caruso-Named-Co-Chair-of-ISITC-Working-Group.aspx'&select=ViewsLifeTime

I tried to compare the page with above api like for the page where I am getting data such as created, created by, modified by, modified etc. So using above API I am able to get data. But for some of the pages I am not able to get the data using the above api.

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

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 34,821 Reputation points Microsoft Vendor
    2023-11-15T02:23:33.9566667+00:00

    Hi @Sayantan Ganguly,

    Per my test, you could use following api to get all aspx file.

    /_api/search/query?querytext='FileExtension:aspx'
    

    Please check if the pages contain files like html, css , js. The api only returns pages which extension is aspx. If you have some html pages, you will need to change the file extension to html.

    YOu can also create the refinement options yourself. how to do this in code: http://techmikael.blogspot.com/2011/08/creating-refinement-query-parameter-for.html


    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.


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.