sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Why does the Kql research give me the numerical values multiplied by 1000?

Open FranBor opened this issue 2 years ago • 3 comments

Target SharePoint environment

SharePoint Online

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

SharePoint CSOM

Developer environment

Windows

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

  • [ ] 💥 Internet Explorer
  • [ ] 💥 Microsoft Edge
  • [X] 💥 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: 103.0.5060.53 (Build ufficiale) (a 64 bit)
  • Microsoft.SharePointOnline.CSOM: 16.1.21213.12000

Describe the bug / error

I have a Number column with the internal name IdDocSet. On the managed properties page I edited the property RefinableDecimal01 with alias IdDocSet and mapping ows_IdDocSet.

enter image description here

Below is the piece of code I use for research

KeywordQuery keywordQuery = new KeywordQuery(context);
keywordQuery.QueryText = "path:https://{MyDocumentLibraryUrl} AND (ContentTypeId:0x0120D520* OR ContentTypeId:0x0101*)";

keywordQuery.CollapseSpecification = "IdDocSet";

keywordQuery.SelectProperties.Add("IdDocSet");

keywordQuery.SortList.Add("IdDocSet", SortDirection.Descending);

SearchExecutor searchExec = new SearchExecutor(context);
ClientResult<ResultTableCollection> resultTableColl = searchExec.ExecuteQuery(keywordQuery);
context.ExecuteQueryRetry();

I get the ClientContext with Azure app registration and the code below:

OfficeDevPnP.Core.AuthenticationManager().
                GetAzureADAppOnlyAuthenticatedContext(siteUrl, azApplicationId, azTenant, certificatePfxPath, certificatePassword);

When I run the code I get the truly value of IdDocSet multiplied by 1000

enter image description here

I need to use the alias in my code, please help me.

Steps to reproduce

  1. Create a SharePoint document library with a "IdDocSet" numeric column
  2. On the managed properties page modify the property RefinableDecimal01 with alias IdDocSet and mapping ows_IdDocSet.
  3. Create a new Azure App registration:
  • add a certificate
  • add the permission SharePoint Sites.FullControl.All
  1. Run the described code

Expected behavior

KQL search return the truly value of IdDocSet multiplied by 1000

FranBor avatar Jul 01 '22 08:07 FranBor

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

ghost avatar Jul 01 '22 08:07 ghost

Any news?

FranBor avatar Jul 07 '22 08:07 FranBor

This seems to work as expected for me. Can you say something about how the number column in SP has been defined? I have number with auto decimals for my test, and all numbers come correct.

wobba avatar Aug 19 '22 08:08 wobba

Fixed from the service side.

wobba avatar Sep 15 '22 18:09 wobba

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Sep 23 '22 00:09 ghost