# Unable to search data containing math expression

**URL:** <https://discuss.elastic.co/t/unable-to-search-data-containing-math-expression/326287>\
**Category:** Elasticsearch\
**Created:** [February 23, 2023, 8:47am UTC](https://discuss.elastic.co/t/unable-to-search-data-containing-math-expression/326287 "2023-02-23T08:47:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hassan\_zaib\_Hayat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hassan_zaib_hayat/32/116419_2.png) [@Hassan\_zaib\_Hayat](https://discuss.elastic.co/u/Hassan_zaib_Hayat)\
**Post date:** [February 23, 2023, 8:47am UTC](https://discuss.elastic.co/t/unable-to-search-data-containing-math-expression/326287/1 "2023-02-23T08:47:33Z")

</div>

Hi ES folks,

Hope everyone is doing fine. I am facing a problem when querying data containing mathematical expressions. For example I have following data indexed in my ES

- what is 3+4
- what is 3-4
- what is 3\*4
- what is 3/4

when I try to search for **what is 3+4** the first response comes out to be **what is 3\*4** the actual result is 3-4 in the response list.

I am using an Arabic analyzer for indexing and searching. I have googled and tried a couple of analyzers but no luck. any help would be appreciated.

```auto
{
    “total”: 5,
    “max_score”: 0.12465363,
    “took”: 2,
    “results”: [
        {
            “sort”: [
                “arabic”,
                0.12465363
            ],
            “_type”: “faqs”,
            “_id”: “63f5fc52fe32c80fc9ef6fcb”,
            “score”: 0.12465363,
            “_score”: 0.12465363,
            “_index”: “faqs_index”,
            “data”: {
                “answer”: [
                    {
                        “content”: “3*4 is 12",
                    }
                ],
                “category”: “arabic”,
                “question”: “what is 3*4"
            }
        },
        {
            “sort”: [
                “arabic”,
                0.12465363
            ],
            “_type”: “faqs”,
            “_id”: “63f5fc67fe32c80fc9ef6fcd”,
            “score”: 0.12465363,
            “_score”: 0.12465363,
            “_index”: “faqs_index”,
            “data”: {
                “answer”: [
                    {
                        “content”: “3-4 is -1"
                    }
                ],
                “category”: “arabic”,
                “question”: “what is 3-4"
            }
        },
        {
            “sort”: [
                “arabic”,
                0.12465363
            ],
            “_type”: “faqs”,
            “_id”: “63f5fc5efe32c80fc9ef6fcc”,
            “score”: 0.12465363,
            “_score”: 0.12465363,
            “_index”: “faqs_index”,
            “data”: {
                “answer”: [
                    {
                        “content”: “3+4 is 7"
                    }
                ],
                “category”: “arabic”,
                “question”: “what is 3+4"
            }
        },
        {
            “sort”: [
                “arabic”,
                0.12465363
            ],
            “_type”: “faqs”,
            “_id”: “63f5fc80fe32c80fc9ef6fce”,
            “score”: 0.12465363,
            “_score”: 0.12465363,
            “_index”: “faqs_index”,
            “data”: {
                “answer”: [
                    {
                        “content”: “3/4 is 0.75"
                    }
                ],
                “category”: “arabic”,
                “question”: “what is 3/4"
            }
        },
        {
            “sort”: [
                “arabic”,
                0.05758412
            ],
            “_type”: “faqs”,
            “_id”: “63f606b5fe32c8132b3b580a”,
            “score”: 0.05758412,
            “_score”: 0.05758412,
            “_index”: “faqs_index”,
            “data”: {
                “answer”: [
                    {
                        “content”: “3/4 is 0.75"
                    }
                ],
                “category”: “arabic”,
                “question”: “what is 3/4"
            }
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [February 23, 2023, 1:39pm UTC](https://discuss.elastic.co/t/unable-to-search-data-containing-math-expression/326287/2 "2023-02-23T13:39:14Z")

</div>

Hi @Hassan_zaib_Hayat

Do you use arabic analyzer for english text?  
I would try some tests with the whitespace analyzer.  
It will not remove the operators, "+ - \*", like other analyzers.

---

<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:** [March 23, 2023, 1:39pm UTC](https://discuss.elastic.co/t/unable-to-search-data-containing-math-expression/326287/3 "2023-03-23T13:39:22Z")

</div>

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