Hi,
I'm trying to integrate the search-UI into our webpage, but there are 2 bugs holding us back and I was wondering if there was an ETA on them or a RoadMap somewhere. The two issues are:
opened 01:43PM - 21 Oct 22 UTC
bug
pinned
elasticsearch-connector
**Describe the bug**
- Once you add a field to search_fields object in search… Query, that is of type 'keyword', a server error occurs and nothing is returned (empty object).
- Searching for fields of type 'text' works fine
- Note that the autocomplete doesn't exactly have the same issue. The autocomplete gives me the responseState correctly, just with 0 suggestions
- Note that I wanted to see if I could get any other type of error by simply removing the index and the same error is thrown. We really need better error handling.
**The server error (nextJS serverside) **
```
error - TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Object.getFacetsFromResponse (/Users/zakaria/Repos/nedap_portal/portal/node_modules/@searchkit/sdk/lib/cjs/core/FacetsFns.js:42:36)
at ElasticSearchResponseTransformer.transformResponse (/Users/zakaria/Repos/nedap_portal/portal/node_modules/@searchkit/sdk/lib/cjs/transformers/index.js:61:27)
at SearchkitRequest.<anonymous> (/Users/zakaria/Repos/nedap_portal/portal/node_modules/@searchkit/sdk/lib/cjs/index.js:126:37)
at Generator.next (<anonymous>)
at fulfilled (/Users/zakaria/Repos/nedap_portal/portal/node_modules/@searchkit/sdk/lib/cjs/index.js:15:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
page: '/api/search'
}
```
**To Reproduce**
Steps to reproduce the behavior:
1. Setup with nextJs like this https://docs.elastic.co/search-ui/guides/nextjs-integration
2. put an index in elasticSearch like so:
```
PUT products
{
"mappings": {
"dynamic":"strict",
"properties": {
"itemType": {
"type": "keyword"
},
"productId": {
"type": "keyword"
},
"productTitle": {
"type": "text"
}
}
}
}
```
3. push data in elasticSearch
4. setup the serach-ui config like this:
```
searchQuery: {
search_fields: {
productId: {},
},
```
**Expected behavior**
either:
- A search that still works, even though it will only return exact matches.
- if type 'keyword' is not supported, give me a correct error message in the response
**Screenshots**
**Which backends and packages are you using:**
Backend: [Elastic Search cloud]
Using the next.js setup from the docs:
```
"@elastic/react-search-ui": "^1.17.1",
"@elastic/react-search-ui-views": "^1.17.1",
"@elastic/search-ui": "^1.17.1",
"@elastic/search-ui-elasticsearch-connector": "^1.17.1",
```
and to a lesser degree: Nested objects are not rendered when `elasticsearch-connector` is used · Issue #907 · elastic/search-ui · GitHub
Thanks
joemcelroy
(Joseph McElroy)
March 1, 2023, 3:23pm
2
hey @AndrewSharp ,
The first issue i've added a workaround. The second issue we haven't made any progress on.
We dont have a roadmap but would be good to share when we do.
Joe
Thanks for the quick response and workaround! I'll try this out now.
system
(system)
Closed
March 29, 2023, 3:35pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.