# Replace dot with Space is not working

**URL:** <https://discuss.elastic.co/t/replace-dot-with-space-is-not-working/240664>\
**Category:** Elasticsearch\
**Created:** [July 10, 2020, 9:30am UTC](https://discuss.elastic.co/t/replace-dot-with-space-is-not-working/240664 "2020-07-10T09:30:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KrishK](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@KrishK](https://discuss.elastic.co/u/KrishK)\
**Post date:** [July 10, 2020, 9:30am UTC](https://discuss.elastic.co/t/replace-dot-with-space-is-not-working/240664/1 "2020-07-10T09:30:52Z")

</div>

Hi Support,

I have created a large index and I am facing issue related filename search.  
Below is the mapping example.

```
  PUT split_test
        {
          "settings":{
          "index" : {
                "number_of_shards" : 1,
                "number_of_replicas" : 0
            },
          "analysis": {
              "analyzer": {
                "splchar_analyzer": {
                  "tokenizer": "standard",
                  "char_filter": [
                    "spl_char_filter"
                  ]
                }
              },
              "char_filter": {
                "spl_char_filter": {
                  "type": "pattern_replace",
                  "pattern": "\\.",
                  "replacement": " "
                }
              }
            }
          }
        }
PUT split_test/_mappings
        {
          "properties": {
            "filename": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }

 POST split_test/_doc
        {
          "filename":"metadata-12345.pdf"
        }
 POST split_test/_doc
        {
          "filename":"metadata.pdf"
        }

```

I tried to replace "." with " ".

still, it's not working when I perform a search, while it shows split using analyze option.

```
POST split_test/_analyze
            {
              "analyzer": "splchar_analyzer",
              "text": "metadata.pdf"
            }

```

When performing a search using SQL query for filenames getting only one result.  
There should be two results.

```
POST _sql?format=txt
{
  "query":"""select filename from split_test WHERE QUERY('(filename:("metadata"))','default_operator=AND')"""
}

```

When performing a search using the below example. getting two results.

```
   POST _sql?format=txt
            {
              "query":"""select filename from split_test WHERE QUERY('(filename:(metadata*))','default_operator=AND')"""
     }

```

Actually I want to use exact match using a double quote and result should be two.

Can you please help me with that?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![KrishK](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@KrishK](https://discuss.elastic.co/u/KrishK)\
**Post date:** [July 13, 2020, 10:31am UTC](https://discuss.elastic.co/t/replace-dot-with-space-is-not-working/240664/2 "2020-07-13T10:31:19Z")

</div>

Anyone can help me on this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 10, 2020, 10:31am UTC](https://discuss.elastic.co/t/replace-dot-with-space-is-not-working/240664/3 "2020-08-10T10:31:24Z")

</div>

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