sp-dev-docs
sp-dev-docs copied to clipboard
Why does the Kql research give me the numerical values multiplied by 1000?
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.
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
I need to use the alias in my code, please help me.
Steps to reproduce
- Create a SharePoint document library with a "IdDocSet" numeric column
- On the managed properties page modify the property RefinableDecimal01 with alias IdDocSet and mapping ows_IdDocSet.
- Create a new Azure App registration:
- add a certificate
- add the permission SharePoint Sites.FullControl.All
- Run the described code
Expected behavior
KQL search return the truly value of IdDocSet multiplied by 1000
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Any news?
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.
Fixed from the service side.
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