Share via

Search response is returning two commas for single comma in URL field

Amol Tidke 1 Reputation point
2021-06-10T13:02:21.113+00:00

Hi Team,

I am using search query to get the result in my spfx code as below:

https://mysiteurl/_api/search/query?querytemplate=%27ContentType:Tools AND (SPTranslationLanguage:{CurrentDisplayLanguage} OR (NOT SPTranslatedLanguages:{CurrentDisplayLanguage} AND NOT SPIsTranslation:true))%27&SelectProperties=%27Title,ListItemID,Description,Path,ToolLinkOWSURLH,ows_BusinessOwner,owstaxIdBusinessOwner,SPContentType%27&rowlimit=100&trimduplicates=false%27

here in the response in the field ToolLinkOWSURLH we get the url of the tool page and its working fine.
eg: ToolLinkOWSURLH: "https://contoso.sharepoint.com/testsite/SitePages/TestTool.aspx

But if I have comma "," in the page name like Test,Tool then it returned two commas in the response as below:
ToolLinkOWSURLH: "https://contoso.sharepoint.com/testsite/SitePages/Test,,Tool.aspx

So Can someone help that why search query is returning two commas for single comma in page url??

Any help is appreciated a lot!!

Thanks & Regards,
Amol Tidke
 

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,136 Reputation points
    2021-06-11T08:58:52.437+00:00

    Hi @Amol Tidke ,

    Could you please share more details of the managed property ToolLinkOWSURLH ? What's the type of that column?

    Per my test, if I search the page directly, the comma shows well for the path property.

    104690-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.