SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

SharePoint Online REST search not working all the time #9056

Open hstuermannfellowmind opened 1 year ago

hstuermannfellowmind commented 1 year ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework 💥 SharePoint REST

Developer environment

Windows

What browser(s) / client(s) have you tested

Additional environment details

Multiple browsers, multiple users and some (many but not all) tenants

Describe the bug / error

The rest search endpoint at "/_api/search/postquery" is answering with 500 internal server error sometimes. It's not everytime but like 8 out of 10 times. It's either very slow or timeouting with this error after ~30s

image

Its not just one webpart or one query. The problem is with multiple spfx webparts on different customer tenants. Its even happening with the PnP Modern Search Webpart. Some tenants do not have any problems as far as I can tell.

Sample query:

{
    "request": {
        "__metadata": {
            "type": "Microsoft.Office.Server.Search.REST.SearchRequest"
        },
        "ClientType": "PnPModernSearch",
        "Properties": {
            "results": [
                {
                    "Name": "EnableDynamicGroups",
                    "Value": {
                        "BoolVal": true,
                        "QueryPropertyValueTypeIndex": 3
                    }
                },
                {
                    "Name": "EnableMultiGeoSearch",
                    "Value": {
                        "BoolVal": true,
                        "QueryPropertyValueTypeIndex": 3
                    }
                },
                {
                    "Name": "ClientFunction",
                    "Value": {
                        "StrVal": "PnPSearchWebPart",
                        "QueryPropertyValueTypeIndex": 1
                    }
                },
                {
                    "Name": "ListId",
                    "Value": {
                        "StrVal": "6e3e70f7-faf2-4263-81cc-c679c5aaa6f5",
                        "QueryPropertyValueTypeIndex": 1
                    }
                },
                {
                    "Name": "ListItemId",
                    "Value": {
                        "StrVal": "1",
                        "QueryPropertyValueTypeIndex": 1
                    }
                }
            ]
        },
        "Querytext": "*",
        "EnableQueryRules": false,
        "QueryTemplate": "{searchTerms} Path:https://*****.sharepoint.com/sites/***** -Title:\"********\" (PromotedState:0 OR PromotedState:2) -Title:Anleitung",
        "SourceId": "8413cd39-2156-4e00-b54d-11efd9abdb89",
        "EnableNicknames": false,
        "EnablePhonetic": false,
        "Culture": 1031,
        "TimeZoneId": 13,
        "Refiners": "Created(discretize=manual/2022-07-03T07:03:44.116Z/2023-04-03T07:03:44.119Z/2023-06-03T07:03:44.119Z/2023-06-26T07:03:44.119Z/2023-07-02T07:03:44.119Z/2023-07-03T07:04:44.119Z),DisplayAuthor",
        "RefinementFilters": {
            "results": []
        },
        "RowLimit": 21,
        "StartRow": 0,
        "TrimDuplicates": false,
        "SortList": {
            "results": [
                {
                    "Property": "LastModifiedTime",
                    "Direction": 1
                }
            ]
        },
        "SelectProperties": {
            "results": [
                "AuthorOWSUSER",
                "contentclass",
                "ContentTypeId",
                "Created",
                "CreatedBy",
                "DefaultEncodingURL",
                "DisplayAuthor",
                "FileType",
                "HitHighlightedSummary",
                "JobTitle",
                "LastModifiedTime",
                "NormListID",
                "NormSiteID",
                "NormUniqueID",
                "NormWebID",
                "owstaxidmetadataalltagsinfo",
                "Path",
                "SiteTitle",
                "SPSiteUrl",
                "Title",
                "UniqueID",
                "UserName",
                "WorkPhone"
            ]
        },
        "HitHighlightedProperties": {
            "results": []
        },
        "ReorderingRules": {
            "results": []
        }
    }
}

Steps to reproduce

Use PnP modern search webpart oder a custom spfx webpart with using search REST endpoint. Not a problem on every tenant.

Expected behavior

The search should work like it did before and not be slow.

ghost commented 1 year ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ascheuch commented 1 year ago

Exactly the same problem with us.

bernhardk4t commented 1 year ago

Same here in several tenants (location: Germany)

morgars commented 1 year ago

Same here in multiple tenants (location:Germany)

hstuermannfellowmind commented 1 year ago

This is resolved for us. Everything is working like expected. Few days of problems and no reaction, no service status update by MS.. Ty for nothing.

ascheuch commented 1 year ago

I have received lots of feedback, but from our users :-( MS obviously doesn't care.

VesaJuvonen commented 1 year ago

Seems that this was a service side issue and not specifically related on the developer platform. As it should have been also visible in the out of the box search experiences, that's how it was most likely reported from the tenant support channels - and it got fixed without support reacting on this side messages - so sorry for the confusion and delay on this side.

Based on the comment from @hstuermannfellowmind - issue seems to be now fixed, but would like to get a confirmation on the status. Personally catching up on things a bit after a vacation, so would love to get an update on this. Thx.

hstuermannfellowmind commented 1 year ago

Hey @VesaJuvonen thank you for the reply. We had no issues so far and it seems working as expected again. From my perspective, the issue can be closed.