Skip to content

KQL Search with CollapseSpecification not working #8576

@FranBor

Description

@FranBor

What type of issue is this?

other

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

SharePoint CSOM

Target SharePoint environment

SharePoint Online

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

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Issue description

I use KQL Search with CollapseSpecification to search within document libraries on several tenants without any problems, but on one tenant this does not work.

I have revised the search patterns and re-indexed the entire site collection but it is not working.
Is there any functionality/configuration I need to enable to make CollapseSpecification work in KQL Search?

I tried the following query with REST Api:

https://{mySharePointSite}/_api/search/query?querytext='test'&selectproperties='RefinableDecimal01'&collapsespecification='RefinableDecimal01'

with or without CollapseSpecification I get 3 results, all items have RefinableDecimal01=34 so the expected result should be 1

The same behaviour occurs with the CSOM code below:

KeywordQuery keywordQuery = new KeywordQuery(context);
keywordQuery.QueryText = "test"
keywordQuery.CollapseSpecification = "RefinableDecimal01";
keywordQuery.SelectProperties.Add("RefinableDecimal01");

Can you help me.

THX

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APItype:archive-old-issueIssues which are closed as tool old for active work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions