SharePoint how to delete quotation marks in search query parameter

Sevil Red 101 Reputation points
2020-08-26T16:04:59.473+00:00

Good day,
I have CustomSearch webpart and Custom Search Sesults Page.
To get Search Results I use Managed Property DocTitleISM. This is the search parameter.
Type “Text”
Mapping to crawling properties ows_BaseName, ows_Title, Title, TermTitle, MetadataExtractorTitle, Office:2, MailSubject, People:PreferredName, Basic:displaytitle, Basic:10, Basic:9, ows_Title0, ows_FileLeafRef.
The search parameter values DocTitleISM can look like

  1. STO KGP 8841271.UIT.5.09.43-2019
  2. PR ISM 3.10.4.1-2020
  3. STO PR 8841271.3.10.12-2019
  4. etc.
    I set some value to my search web part field. Then pressed “Search”
    My search query url looks like
    http://<MySite>/SitePages/customSearchPage.aspx?k=DocTitleISM%3A”STO KGP 8841271.UIT.5.09.43-2019”
    I get results. Ok.
    But for query url
    http://<MySite>/SitePages/customSearchPage.aspx?k=DocTitleISM%3A”PR ISM 3.10.4.1-2020”
    http://<MySite>/SitePages/customSearchPage.aspx?k=DocTitleISM%3A”STO PR 8841271.3.10.12-2019”
    I get no results, but these items exist. This is the problem.
    If I change search query url manually and delete quotation marks after DocTitleISM%3A, I always get results.
    This queries without “” work fine
    http://<MySite>/SitePages/customSearchPage.aspx?k=DocTitleISM%3ASTO KGP 8841271.UIT.5.09.43-2019
    http://<MySite>/SitePages/customSearchPage.aspx?k=DocTitleISM%3APR ISM 3.10.4.1-2020
    http://<MySite>/SitePages/customSearchPage.aspx?k=DocTitleISM%3ASTO PR 8841271.3.10.12-2019
    I must send the search query with DocTitleISM parameter without quotation marks to get results for all parameter values.
    How can I change search query after “Search” clicking to get search query url parameter without quotation marks?
    Send my webPart file.
    Would be grateful for any help.20564-ismadvancedsearchquestion.txt
SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,340 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,685 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,608 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Baker Kong-MSFT 3,801 Reputation points
    2020-08-27T02:54:34.76+00:00

    Hi SevilRed-0007,

    I imported your custom web part and tested it in my SPO site. However it works well and the query url does not have quotations.

    20685-test.gif

    I have mapped the mentioned crawling properties to DocTitleISM:

    20785-image.png

    Here the query url is ".../osssearchresults.aspx?k=DocTitleISM%3APRISM3.10.4.1-2020", it does not have quotations. What i changed is the result page, since i do not have 'customSearchPage.aspx', i change it to the orginal search result page (osssearchresults.aspx). Is this quotation mark bringed from the custom page?

    Best Regards,
    Baker Kong


    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Sevil Red 101 Reputation points
    2020-08-27T08:01:53.347+00:00

    Good day,

    Thanks for reply. I changed my custom search web part properties and now send my search results to
    <MySite>/_layouts/15/osssearchresults.aspx

    I have the same results :-(

    My search query url have quotations

    http://<MySite>/_layouts/15/osssearchresults.aspx?k=DocTitleISM%3A"PR ISM 3.10.4.1-2020"


Your answer

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