Show suggest result on Front end without hampering speed of ES


(Arpit Dadheech) #1

I am using ES with angular 2.
I am using suggester of ES. I am getting the results as I want.
Like I type "A"

I get result set as
[ "Alexander", "Alexander Ambrose", "Crown Victoria"]
and
[ "Cleo", "Cleo Walling","Aerostar" ]

I want to show suggestion on frontend in angular 2 as
Alexander
Alexander Ambrose
Aerostar

How to do it without affecting the speed of ES
Any suggestions

Thanks In advance
@kimchy @s1monw @Allwyn @dadoonet @rmuir @colings86


(David Pilato) #2

Please don't ping people who are not part of the conversation already like you did.

Read this and specifically the "Also be patient" part.


(Arpit Dadheech) #3

So whome should I ping If I am stuck.


(Arpit Dadheech) #4

Elasticsearch version 6.1
Plugins installed: None
JVM version 1.8
OS version windows

I have used "Suggester" suggester.
I have dumped data as:-

put datas/data/1
   {
         "first_name": "Demo",
          "last_name": "Demo",
        "nike_name": "Aero",
         "suggest" : ["Demo", "Demo", "Aero"]
     }

put datas/data/2
 {
         "first_name": "Alex",
          "last_name": "Alex Ambrose",
          "nike_name": "Demo",
          "suggest" : ["Alex", "Alex Ambrose", "Demo"]
 }

It give me output

"suggest": {
       "suggest": [
                   {
                       "text": "A",
                       "offset": 0,
                       "length": 1,
                       "options": [
                                          {
                                            "text": "Aero",
                                           "_index": "er_data",
                                            "_type": "data",
                                           "_id": "1",
                                           "_score": 1,
                                           "_source": {
                                               "suggest": [
                                                           "Demo",
                                                           "Demo",
                                                           "Aero"
                                                ]  
                                             } 
                                          },
                                         {
                                           "text": "Alex",
                                           "_index": "er_data",
                                           "_type": "data",
                                           "_id": "2",
                                           "_score": 1,
                                           "_source": {
                                                  "suggest": [
                                                       "Alex",
                                                        "Alex Ambrose",
                                                        "Demo"
                                                     ]
                                                  }
                                            }
                                        ]
                                   }

Two result set are correct why it does not give me "Alex Ambrose" in the output "Text" field as it returns me "Alex" and "Aero"

My search query is

"suggest": {
      'suggest': {
                'text':"A",
                 'completion': {
                             'field': 'suggest'
                  }
           }
  }

Can you please suggest about this as well ??


(David Pilato) #5

So whome should I ping If I am stuck

Nobody.

Let the community decide if someone wants to answer.
As written in the page I linked to:

There are no SLAs on responses to questions posted on this forum, if you require help with an SLA on responses you should look into purchasing a subscription package that includes support with an SLA such as those offered by Elastic.


(David Pilato) #6

Please format your code using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

Please edit your post.


(Arpit Dadheech) #7

I have done editing. Can you please check now.

Sorry for inconvenience.


(system) #8

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