2

My elastic search provides the results as an elastic array. Here is how the mappings look.

 "positions": {
            "properties": {
              "en": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "fr": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }

So this gives me result as below.

"companyinfo.positions.en": " Chain Corporate, Food Services, Service Manager, Restaurant Manager, Cybercafé Manager, Internet Café Manager, Assistant Bar Manager, Assistant Manager, Restaurant Assistant Manager, Banquet Manager, Bar Manager, Cafeteria Manager",

I am using value as "companyinfo.positions.en" for the dataField property of the DataSearch control.

Currently I am not using the onSuggestion property, rather I am expecting DataSearch to provide me the suggestions automatically. But it is not giving me any suggestions. But the control gives me the search results as expected.

<DataSearch 
    componentId={id}
    dataField={'companyinfo.positions.en'}        
    placeholder={'Search Jobs'}                
    URLParams={true}
    autosuggest={true}        
    showClear={true}                
    />      

If I provide any other textfield as a dataField for the DataSearch control, then I get the suggestions, why not it works for the elastic array fields.

Please suggest what I can do to get the suggestions correctly. If I will have to use the onSuggestion property, how do I provide the field name as for the label, I can't provide the field name.

Naibedya Kar
  • 305
  • 2
  • 9
  • Could you try adding these custom analyzers https://opensource.appbase.io/reactive-manual/getting-started/data.html#custom-analyzers. They help `DataSearch` in fetching suggestions. Also if you can create a codesandbox example, I can tell better :) – Divyanshu Maithani Aug 01 '18 at 14:41
  • @DivyanshuMaithani please take a look at this one https://codesandbox.io/s/m5wmk6rqyy – Naibedya Kar Aug 10 '18 at 10:46

1 Answers1

1

This was an issue with nested array fields in the library and was fixed in v2.8.2. Changelog

Divyanshu Maithani
  • 13,908
  • 2
  • 36
  • 47