0

I'm new to Elasticsearch. I'm trying a query and when giving full name I'm getting results. When I give part of it, it's not returning any results. Below is the sample that I have been trying.

   {
     "query": {
     "multi_match": {
     "query": "recharge",
      "fields":     ["category.*","categoryName^3","alterNames","categoryDescription"],
      "type": "best_fields"
    }
  },size:1000
  }

If I pass "rech" in the query, I'm not getting any results. Can any one help me here?

almcd
  • 1,069
  • 2
  • 16
  • 29
SoftwareNerd
  • 1,875
  • 8
  • 29
  • 58
  • Possible duplicate of [ElasticSearch how to use multi\_match with wildcard](http://stackoverflow.com/questions/16933800/elasticsearch-how-to-use-multi-match-with-wildcard) – VMAtm Sep 08 '16 at 17:31
  • How are each of the fields analyzed at index time? – Russ Cam Sep 08 '16 at 23:28

1 Answers1

0

As far as I understand, you want to get the results with unfinished query, so you need a wildcard, like this:

{
  "query": {
  "multi_match": {
    "query": "rech*",
    "fields": ["category.*", "categoryName^3", "alterNames", "categoryDescription"],
    "type": "best_fields"
  }
}
VMAtm
  • 27,943
  • 17
  • 79
  • 125