How to query special characters

Hi,

I have been trying to search for a full match for "D&H" as a string from website content dumps but the results I have been getting do not seem to have the result at all. what is the correct way of querying? I have tried query string /match and match_phrase and I have gotten similar results for all. Do we have to set a custom analyzer for this?

Mapping I am using:

{'dev_web2': {'aliases': {}, 'mappings': {'en': {'properties': {'analyzer': {'type': 'text', 'fields': {'keyword': {'type': 'keyword', 'ignore_above': 256}}}, 'content': {'type': 'text', 'store': True, 'term_vector': 'yes', 'analyzer': 'english', 'fielddata': True}, 'domain': {'type': 'keyword'}, 'error': {'type': 'keyword'}, 'ids': {'type': 'text', 'fields': {'keyword': {'type': 'keyword', 'ignore_above': 256}}}, 'odate': {'type': 'date'}, 'parameters': {'properties': {'_index': {'type': 'text', 'fields': {'keyword': {'type': 'keyword', 'ignore_above': 256}}}, '_type': {'type': 'text', 'fields': {'keyword': {'type': 'keyword', 'ignore_above': 256}}}, 'field_statistics': {'type': 'boolean'}, 'fields': {'type': 'text', 'fields': {'keyword': {'type': 'keyword', 'ignore_above': 256}}}, 'filter': {'properties': {'max_num_terms': {'type': 'long'}, 'max_word_length': {'type': 'long'}, 'min_doc_freq': {'type': 'long'}, 'min_term_freq': {'type': 'long'}, 'min_word_length': {'type': 'long'}}}, 'offsets': {'type': 'boolean'}, 'payloads': {'type': 'boolean'}, 'positions': {'type': 'boolean'}, 'term_statistics': {'type': 'boolean'}}}}}}, 'settings': {'index': {'number_of_shards': '5', 'blocks': {'write': 'false'}, 'provided_name': 'dev_web2', 'creation_date': '1542418329521', 'number_of_replicas': '1', 'uuid': 'EuP2lGHtRrmc6InivOvRxg', 'version': {'created': '6030199'}}}}}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.