Improve search results for fields

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?

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.

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?

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