Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ElasticSearch 7.0.0 #948

Closed
danielsnider opened this issue Apr 16, 2019 · 4 comments
Closed

Support for ElasticSearch 7.0.0 #948

danielsnider opened this issue Apr 16, 2019 · 4 comments
Assignees

Comments

@danielsnider
Copy link

Hi,

I'm wondering if you'll be supporting ElasticSearch 7.0.0 eventually?

I gave 7.0.0 a try using ReactiveSearch 2.16.1 and I get the following error:

Objects are not valid as a React child (found: object with keys {value, relation}). If you meant to render a collection of children, use an array instead. in p in div in Styled(div) in div in ReactiveList in Connect(ReactiveList) in ResultCard (at index.jsx:391) in div (at index.jsx:369) in div (at index.jsx:366) in div in Styled(div) in URLParamsProvider in Connect(URLParamsProvider) in Provider in ThemeProvider in ReactiveBase (at index.jsx:363) in div (at index.jsx:362) in Main in t in Container in App
Invariant Violation: Objects are not valid as a React child (found: object with keys {value, relation}). If you meant to render a collection of children, use an array instead.
    in p
    in div
    in Styled(div)
    in div
    in ReactiveList
    in Connect(ReactiveList)
    in ResultCard (at index.jsx:391)
    in div (at index.jsx:369)
    in div (at index.jsx:366)
    in div
    in Styled(div)
    in URLParamsProvider
    in Connect(URLParamsProvider)
    in Provider
    in ThemeProvider
    in ReactiveBase (at index.jsx:363)
    in div (at index.jsx:362)
    in Main
    in t
    in Container
    in App
    at invariant (/home/dan/aim-platform/image-archive/reactive-search/node_modules/fbjs/lib/invariant.js:42:15)
    at traverseAllChildrenImpl (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react/cjs/react.development.js:805:7)
    at traverseAllChildrenImpl (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react/cjs/react.development.js:778:23)
    at traverseAllChildren (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react/cjs/react.development.js:833:10)
    at mapIntoWithKeyPrefixInternal (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react/cjs/react.development.js:909:3)
    at toArray (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react/cjs/react.development.js:956:3)
    at ReactDOMServerRenderer.renderDOM (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react-dom/cjs/react-dom-server.node.development.js:2473:18)
    at ReactDOMServerRenderer.render (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react-dom/cjs/react-dom-server.node.development.js:2298:21)
    at ReactDOMServerRenderer.read (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react-dom/cjs/react-dom-server.node.development.js:2234:19)
    at renderToString (/home/dan/aim-platform/image-archive/reactive-search/node_modules/react-dom/cjs/react-dom-server.node.development.js:2501:25)
    at renderPage (/home/dan/aim-platform/image-archive/reactive-search/node_modules/next/dist/server/render.js:180:26)
    at Function.renderPage [as getInitialProps] (/home/dan/aim-platform/image-archive/reactive-search/.next/dist/bundles/pages/webpack:/pages/_document.js?2bd2:8:18)
    at _callee$ (/home/dan/aim-platform/image-archive/reactive-search/node_modules/next/dist/lib/utils.js:36:30)
    at tryCatch (/home/dan/aim-platform/image-archive/reactive-search/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/dan/aim-platform/image-archive/reactive-search/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/dan/aim-platform/image-archive/reactive-search/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
@mikeq
Copy link

mikeq commented Apr 19, 2019

This particular error is now due to total hits no longer returns a number but an object

https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#_literal_hits_total_literal_is_now_an_object_in_the_search_response

{
    "hits": {
        "total": {
            "value": 1000,
            "relation": "eq"
        },
        ...
    }
}

@joepio
Copy link
Contributor

joepio commented May 2, 2019

Workaround in your ReactiveList component:

      renderResultStats={props => 
         <div>{props.numberOfResults.value} results found.</div>
      }

@Jscott388
Copy link

@joepio this isn't working for me.

@StephanMa
Copy link

Anything new on this one? Currently i have to delete the total number to make it run. Unfortunately the pagination does not work without the total number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants