0

I'm having a hard time figuring out how to set up Elasticsearch for the typical product model nomenclature. For instance, a product called "Shure SM7B" should appear as a result when searching for SM7B, SM 7B, SM 7, SM-7... and vice versa: searching for SM7B should give results like SM-7, SM7...

For now, I'm getting this kind of results: if I search for "Roland D 50", I get Roland D 50, Roland D-50, Roland D-550, Roland D-20 and so on... but if I search for "Roland D50", I get only "Roland D50" results.

This is my current mapping/settings:

{
  "products" : {
    "mappings" : {
      "Product" : {
        "properties" : {
          "article_reviews" : {
            "type" : "integer"
          },
          "brand_id" : {
            "type" : "integer"
          },
          "category" : {
            "type" : "text"
          },
          "category_id" : {
            "type" : "integer"
          },
          "date" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "description" : {
            "type" : "text"
          },
          "has_image" : {
            "type" : "integer"
          },
          "id" : {
            "type" : "integer"
          },
          "last_review_date" : {
            "type" : "date",
            "format" : "yyyy-MM-dd HH:mm:ss"
          },
          "min_price" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "name" : {
            "type" : "text"
          },
          "name_order" : {
            "type" : "keyword"
          },
          "price_history" : {
            "type" : "integer"
          },
          "rating" : {
            "type" : "float"
          },
          "reviews" : {
            "type" : "integer"
          },
          "shops" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "widget" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  }
}

Also, I'd need to autocomplete my searches, so for instance, "Shure SM" should show results like Shure SM-7, Shure SM7, Shure SM58, Shure SM 57, etc... narrowing them down as I type.

Any clues? Thank you!

Xavier
  • 1
  • 2

0 Answers0