0

I'm a bit confused using the SharePoint 2013 search API. I have a managed property "owsBeslissingsOrgaan", which is basicly a metadata field. For this property, we enabled "Complete matching" because we only want results with the exact value we provided.

Complete matching enabled for crawled property

For values without quotes, we get responses as expected:

Search request without quotes

However, for values with a quote, we get zero results which seems incorrect. For validating this, by using refiners, I manually searched for the value (with quote) in the document library itself:

Manual search using refiners

Now, when I try to do this using the Search Query Tool, I've read that I have to replace the single quote by two single quotes (using one single quote will result in a 400 Bad Request error). However, I get zero results:

Search request with quote

The main goal is to use a POST request in a react page which calls the search API:

{
"request": {
    "Querytext": "owsBeslissingsOrgaan:\"Commissie Programma's\"",
    "SelectProperties": {
        "results": [...]
    },
    "RowLimit": 200,
    "TrimDuplicates": false,
    "ClientType": "ContentSearchRegular",
    "SortList": {
        "results": [...]
    }
}

}

Questions

  1. In the POST request, should I use one or two single quotes? My guess would be just one, as it does not need to be escaped here (GET vs POST)?
  2. Is 'Complete Matching' causing this?
  3. Could there be another property of the crawled property that causes this behaviour? E.g. Token Normalization?
  4. Is there something else I'm not understanding or doing wrong?
0

I'm providing my finding on this:

  1. With SharePoint Search Query tool, version v2.8.6, Two Single Quotes returns results. See the screenshot below

  2. Complete Matching does not seem to have an impact. I've turned it on for this particular managed property, ran a Full Crawl, and found search still returns results.

  3. Any other property to look into? I would suggest checking NoWordBreaker for the SSA. We had a similar issue with GUID value search, that is, searching with partial value was working, but was not working for the exact match. We found that this property was set to false in our SSA. After setting it to true, had to recrawl the items to resolve the issue. See the PS scripts below

#1. Find the current value of NoWordBreaker  
$ssa = Get-SPEnterpriseSearchServiceApplication
$mp = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa -Identity "ManagedPropDocumentId"
$mp | select NoWordBreaker 

#2. Set NoWordBreaker true
$ssa = Get-SPEnterpriseSearchServiceApplication
Set-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa -Identity "ManagedPropDocumentId" -NoWordBreaker $true     

# 3 - Start a Full Crawl

Search Tool returns results with two Single Quotes (replacing apostrophe)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.