My requirement is to search for a file in my entire SharePoint Online (SPO) using Graph apis. I have my query something like this which I use in MS Graph Explorer:
https://'my domain'.sharepoint.com/_api/search/query?Querytext='res1a2b3c4d5e'
Basically above query is to search for all the documents having title/name as 'res1a2b3c4d5e'. This works fine if I search for any existing document. If I try to search for any document which was created/uploaded just before making above call I wont get the result.
If I search for the same after couple of minutes, then the request succeeds. Where as when I try the same on my customers site where it has millions of documents. It nearly takes around 20+ hours before I can do a successful search
So does graph api work on any SPO cache?
How can I search for newly added file without having to wait for 20+ hours?
Thanks in advance.
The search results will be available only after the search content is crawled and available in search index. While you can control the crawl schedule in SharePoint On-Premise, you cannot do so in SharePoint online. Crawling frequency in SharePoint online is managed by Microsoft.
More Details
Related
I'm trying to fetch recent files from SharePoint Online using Microsoft Graph.
The API I'm using is :
https://graph.microsoft.com/v1.0/me/drive/recent
But the results include files from all site collection. I need to restrict the results to only a single site collection.
After some research, I found that there is no direct API to restrict the site collection.
I also tried using adding filter like :
$filter=sharepointIds/siteId eq 'site-id'
but it was also not working. It gave a `501 (Not implemented) error.
Update:
I found another API from Graph which is
https://graph.microsoft.com/beta/me/insights/used
which is inside insights(beta) named "items viewed and modified by me"
But it again returns data across tenant and I need to restrict it to a single site collection. I guess filter conditions are not yet implemented for this API in Graph.
Is there any method to get recent files from a particular site collection? Any help is appreciated.
One correction, /me/drive/recent isn't pulling from all site collections, it's pulling from the current user's OneDrive. This includes recent files held within their drive and any recent changes to files that have been shared with them.
As for finding Recent Files from a SharePoint Document Library, you need to make this request within the context of the drive you want to pull from. For example:
https://graph.microsoft.com/v1.0/sites/root/drives/{documentLibraryId}/recent
I am trying to implement a feature in our app to allow users to search for files in their Sharepoint & OneDrive accounts, as they see in Office365.
I am having trouble understanding why I am not seeing expected results from search API requests.
When I make a search request like this, I get 1 result as expected:
https://graph.microsoft.com/v1.0/sites/{my-site -id}/drive/root/search(q='brisbane')
However, when I search like this, there are no results:
https://graph.microsoft.com/v1.0/me/drive/search(q='brisbane')
If I modify the query for /me/drive/search, I do see results from OneDrive, but not from SharePoint.
According to the Microsoft Graph docs, /me/drive/search should search for 'Items a user can access'.
Is this the expected result? Is there any way to search all the current users' Sharepoint sites? Or do I have to ask the user to configure the sites they would like to search, then search each of them separately?
This is by design. You need to read below the "Searching for items a user can access" heading to understand what this means:
In addition to searching for items within a drive, your app can search more broadly to include items shared with the current user. To broaden the search scope, use the search method on the Drive resource.
When you're searching /me/drive/ you are searching that user's OneDrive for files they have uploaded themselves or have been explicitly shared with them. Files that live within a SharePoint library that a user happens to have access to are quite different than files "shared" with that user.
I observed that when I create a folder in OneDrive and Search for the same in Graph Explorer immediately, an empty collection is returned. Is there any time delay which is expected? Is there any scheduling for indexing of the drive items?
I am searching for the folder- SearchFolder using the query :
/v1.0/me/drive/root/search(q='SearchFolder')?select=name,id,webUrl
If I search for some old folders/documents search is working fine.
Also even after deleting, few items are returned in the search results.
How can we overcome this?
The search API uses a search service under the covers, which requires indexing of content. As a result, there will be some time between creation of an item and when it will appear in search results. What that time is has, to my knowledge, not been documented.
I am currently working on document search in google. I don't want to do HTML parsing at all. However looking for some api which search google documents from internet.
Basically I do have one requirement where there is a task of searching .pdf, .doc files from google search. I have done some googling and found that this cause captcha to be introduce from google and there is limit of 100 query / day.
Is there any free API from google or if not any paid by which i can pass some search query and get the result.
Please note, i don't want HTML parsing at all.
Moreover, Is there any way to overcome the issue of Captch??
It would help if I could do a search log analysis for my research. Is it possible to use a search API (Google, Yahoo, Bing) to create a log of web search queries over a specified time span, or is it available on request?
The only thing I know of is the old aol search logs which they released a while back. You can find it on some of the torrent sites. for news about it read this