# Improve search results for fields

**URL:** <https://discuss.elastic.co/t/improve-search-results-for-fields/147498>\
**Category:** Elasticsearch\
**Created:** [September 6, 2018, 5:54am UTC](https://discuss.elastic.co/t/improve-search-results-for-fields/147498 "2018-09-06T05:54:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yash\_Sharma](https://avatars.discourse-cdn.com/v4/letter/y/ecc23a/32.png) [@Yash\_Sharma](https://discuss.elastic.co/u/Yash_Sharma)\
**Post date:** [September 6, 2018, 5:54am UTC](https://discuss.elastic.co/t/improve-search-results-for-fields/147498/1 "2018-09-06T05:54:20Z")

</div>

I am using elastic search to display and search products in my app. My data base looks like this-

| Category | Scat | Sscat | Products | Measure | Price |
| --- | --- | --- | --- | --- | --- |
| Beverages | Soft Drinks | Cans | Pepsi My Soft Drink 250Ml | 250Ml | 30 |
| Household Needs | Laundry Detergents | Detergent Powders | Ariel Matic Top Load Detergent Powder 2Kg | 2Kg | 449 |
| Household Needs | Dishwashers | Scrubbers | Gala Sponge Wipe 5 Units | 5 Units | 195 |
| Personal Care | Hair Care | Shampoo | Ayush Anti Dandruff Neem Shampoo 330Ml | 330Ml | 199 |

I am using the following template to map data in my index.

```
{
  "template_1": {
    "order": 0,
    "index_patterns": [
      "ubq-*"
    ],
    "settings": {
      "index": {
        "number_of_shards": "1"
      }
    },
    "mappings": {
      "doc": {
        "properties": {
          "Index": {
            "type": "float",
            "index": "true"
          },
          "Category": {
            "type": "keyword",
            "index": "true"
          },
          "Scat": {
            "type": "keyword",
            "index": "true"
          },
          "Sscat": {
            "type": "keyword",
            "index": "true"
          },
          "Products": {
            "type": "keyword",
            "index": "true"
          },
          "Measure": {
            "type": "keyword",
            "index": "true"
          },
          "Price": {
            "type": "float",
            "index": "true"
          },
          "Description": {
            "type": "keyword",
            "index": "true"
          },
          "Gst": {
            "type": "float",
            "index": "true"
          }
        }
      }
    },
    "aliases": {}
  }
}

```

My question is when i perform search on products, if the first letter is capitilized and I give lowercase letter, i dont get results. When i give a space while search, it starts a totally new search.

How to make elastic perform search ignoring cases? and how should i make elastic not start a new search after spaces?

I am also displaying all the products in their respective sscat, but in some sscat data is coming from other sscat.  
How to make sure sscat displays only those products that belongs to it not other data?

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [September 7, 2018, 8:16am UTC](https://discuss.elastic.co/t/improve-search-results-for-fields/147498/2 "2018-09-07T08:16:24Z")

</div>

Fields that are used for full text search, such as your `Products` field are typically mapped as type `text` instead of as type `keyword`. [Text fields support features like case-insensitive search because strings that are mapped as type text go through a process called text analysis](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html).

I don't understand your second question. Maybe you can post the request that you're sending Elasticsearch, and the response that you get back with an explanation of how it differs from what you wanted to get back?

---

<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:** [October 5, 2018, 8:16am UTC](https://discuss.elastic.co/t/improve-search-results-for-fields/147498/3 "2018-10-05T08:16:35Z")

</div>

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