1

Recently I've started to learn elasticsearch and currently working with some sample product data. Now I want to suggest the product as user type it. I've checked some documentations for Completion Suggester and implemented some examples for completion.

I checked some benefits of using _suggest than normal _search like

  • SPEED
  • Real Time
  • Readability
  • Custom Ordering

Here is the script I tried:

`POST /products/_suggest
 {
  "product" : {
     "text" : "fres",
     "completion" : {
        "field" : "name"
       }
   }
 }`

But now, I want to implement suggester that will suggest as user type with the picture of product and some other options with product name like Add to cart etc

I am implementing all this with the help of elasticsearch-rails gem over ruby on rails.

So can I do it with normal completion type as it provides lots of feature over search or else normal search will be good for this scenario?

Avinash
  • 497
  • 1
  • 6
  • 19

1 Answers1

0

Elastic Search (ES) allows things that "normal search" won't: extended full text search end especially fuzzy search (a typo like 'hoem' can return 'home' anyway...).

But an ES query returns only data that is indexed in ES !

You will probably not index your pictures so you'll have to process the ES answer and generate a 'pretty' suggest listing with pictures (ES will return entries with both ES and ActiveRecord IDs)

Feel free to ask if you need more details

gfd
  • 1,281
  • 1
  • 13
  • 19
  • Yeah it's okay, but I am implementing autocomplete suggestions, and what I found is _suggest API in ES. But it can only works on a single field as per my readings. So how can I implement top suggestions with more than extra fields? – Avinash Nov 09 '16 at 06:25
  • Anyways, If there is any other way than _suggest API then please suggest for autocomplete. – Avinash Nov 09 '16 at 06:27