# Find "star wars" when i'm looking for "starwars"

**URL:** <https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026>\
**Category:** Elasticsearch\
**Created:** [May 23, 2018, 4:03pm UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026 "2018-05-23T16:03:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arth](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Arth](https://discuss.elastic.co/u/Arth)\
**Post date:** [May 23, 2018, 4:03pm UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026/1 "2018-05-23T16:03:07Z")

</div>

Hi,

I have 200 products with the trade name "star wars" (separated by white space) but I don't get results when I'm searching "starwars" (all of it in lower case letters, not "StarWars") ?

Is there a way please ?

---

<div class="post-metadata">

**Author:** ![klof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klof/32/31590_2.png) [@klof](https://discuss.elastic.co/u/klof)\
**Post date:** [May 24, 2018, 10:48am UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026/2 "2018-05-24T10:48:55Z")

</div>

Hi,  
the only way I see to match "starwars" with "star wars", is to use the synonyms.  
In that case, by simple expansion, you could have :

`starwars, star wars`

The expansion will add the term "starwars" to the documents with "star wars", so these documents will match searches "starwars" and "star wars".

---

<div class="post-metadata">

**Author:** ![Arth](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Arth](https://discuss.elastic.co/u/Arth)\
**Post date:** [May 24, 2018, 11:51am UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026/3 "2018-05-24T11:51:06Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![chocomuesli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chocomuesli/32/4152_2.png) [@chocomuesli](https://discuss.elastic.co/u/chocomuesli)\
**Post date:** [May 24, 2018, 12:29pm UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026/4 "2018-05-24T12:29:15Z")

</div>

You may consider to include [Fuzzyness](https://www.elastic.co/guide/en/elasticsearch/guide/current/fuzziness.html), when searching. Have you tried [Fuzzy-queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html)?

Cheers, Dominik

---

<div class="post-metadata">

**Author:** ![Varan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varan/32/32120_2.png) [@Varan](https://discuss.elastic.co/u/Varan)\
**Post date:** [May 24, 2018, 12:41pm UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026/5 "2018-05-24T12:41:21Z")

</div>

You should consider building an analyzer that consider that "star wars" and "starwars" are the same word by making it think that a space (\u0020) is equal to nothing.

```
"settings": {
    "analysis": {
      "char_filter": {
        "Char_filter_ponctuation": {
          "type": "mapping",
          "mappings": [
            "\\u0020 => ",
          ]
        },
      "tokenizer": {
        "one_tokenizer": {
          "type": "keyword"
        }
      },
      "analyzer": {
        "one": {
          "tokenizer": "one_tokenizer",
          "char_filter": [
            "Char_filter_ponctuation",
            ]}}}}}
```

---

<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:** [June 21, 2018, 12:41pm UTC](https://discuss.elastic.co/t/find-star-wars-when-im-looking-for-starwars/133026/6 "2018-06-21T12:41:21Z")

</div>

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