FTS query doesn't find a field that has "#" character

I’m running N1QL query on Couchbase Enterprise Edition 6.5.1 build 6299 and it doesn’t return a result. Issues is caused by the adSecUntCd field. If I exclude this field from a query, it works and returns a result. In the document itself, field is set as "adSecUntCd": "#",

SELECT r.*
FROM B234 r
WHERE r.docType=‘UmBus’
AND SEARCH(r, {“must”: {“conjuncts”:[
{“field”:“adSecUntCd”, “match”: “#”},
{“field”:“adP2DNa”, “match”: “New York”},
{“field”:“bpyCoNa”,“Fuzziness”:1, “match”: “Alex”}]}},
{“index”:“FTSIDX”})

In FTS index, adSecUntCd is defined as:

“adSecUntCd”: {
“enabled”: true,
“dynamic”: false,
“fields”: [
{
“include_in_all”: true,
“include_term_vectors”: true,
“index”: true,
“name”: “adSecUntCd”,
“type”: “text”
}

Thank you !

This probably has to do with the analyzer you’re using for adSecUntCd in the FTS index definition. The analyzer must be dropping the character. If you’ve not made any analyzer changes in the FTS index definition, it’s likely using the “Standard” analyzer causing this situation.

I’m not sure what kind of content adSecUntCd contains, but by the looks of this query a “keyword” analyzer should do the trick. Update the index definition and your query should work just fine.