Code Monkey home page Code Monkey logo

spo-trigger-reindex's People

Contributors

hulabandula avatar kkrzaczkowski avatar matthewmcd avatar wobba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

spo-trigger-reindex's Issues

Tenant Reindex 401 UnAuthorized

Good day

We have a need to reindex our Entire SharePoint Online due to refiner/metadata changes and issues related to Search in some areas. We have been directed to this page for your script. I have installed the latest CSOM as indicated and ensured the path appears correct (update from \15 to \16 in this case as well). My account running the script is a tenant GA and for every site that my account is not a member of the local Site Collection Admin (which is many as by default it is not of course), I am receiving the below error which I also presume is not actually setting any value as a result for reindex?

-- Updated search version: 1
Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (401) Unauthorized."

In other rarer cases I may receive this in the output to host instead:

-- Updated search version: 1
Exception calling "ExecuteQuery" with "0" argument(s): "Access denied. You do not have permission to perform this
action or access this resource."

Which I also presume is producing a non-successful trigger?

Does my account being used to run the script actually need to be physically added to each site as a Site Collection Admin (minimum) in order for this script to process and work properly or have I done/configured something incorrectly? We have years of SharePoint sites now so this will be a bit of a pickle to add and communicate a new "strange user" or group added to each site if that is the case :-)

As an FYI, the reindex-site targeted at a site that I'm the owner or added to the Site Collection Admin or any sites that I have noted passing by in the output that I'm the same has not produced those errors and incremented the -- Updated search version: to 2 or 3 depending.... And a 'noob' question, what is the "search version" actually saying (and presume "1" is not a good value)

Thanks

Exception

Hello,

Maybe a silly one but cannot resolve this.

When running the User Re-index it comes back with exception see attached.

Untitled

Please help.

Regards,

Adam B.

Access denied. You do not have permission to perform this action or access this resource

vti_searchversion property does not exist for Site or Web and then result in following error while setting it to 1 on Line 40 and 41 of both Site and tenant script.

Exception calling "ExecuteQuery" with "0" argument(s): "Access denied. You do not have permission to
perform this action or access this resource."

I am using Global Admin account who has SCA on all site collections.

is:issue is:open how can we trigger incremental crawl when new docs are added and they need to be searched immediately-"startFullCrawl": true powerautomate http post

is:issue is:open how can we trigger incremental crawl when new docs are added and they need to be searched immediately-"startFullCrawl": true powerautomate http post

I tried below-
Create a new Power Automate flow and choose "HTTP" as the trigger.
Add an "HTTP" action to make a POST request to the SharePoint Search REST API endpoint. The URL for the endpoint is typically in the format: https:///_api/search/admin/fullcrawl.
In the "Headers" section of the HTTP action, add the following key-value pairs:
"Accept": "application/json;odata=verbose"
"Content-Type": "application/json;odata=verbose"
"X-RequestDigest": "" (you will need to obtain the RequestDigest value from the SharePoint site)
In the "Body" section of the HTTP action, add the following JSON payload:
json
Copy code
{
"startFullCrawl": true
}
Save the flow and test it by running it. This should trigger a full search crawl on the SharePoint site.
Note: The above steps assume that you have the necessary permissions to trigger search crawls on the SharePoint site.

Ami Loh
how to use graph api to search document libraries
You can use Microsoft Graph API to search for documents in a SharePoint document library by making a GET request to the /search endpoint. Here's an example of how you can search for all documents in a document library named "Documents" in a site named "MySite":

Construct the URL for the search request: https://graph.microsoft.com/v1.0/sites/MySite:/drive/root/search(q='fileExtension:docx')
Add an "Authorization" header to the request with a valid access token.
Send the GET request to the URL.
The response will contain an array of search results, each of which represents a document in the document library. You can use the properties of each search result, such as webUrl, to access the document or to display information about it.

Note: You'll need to have the necessary permissions to access the SharePoint site and document library, as well as to make requests to the Microsoft Graph API.

{
"startFullCrawl": true
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.