diff --git a/package.json b/package.json
index 8d0be88..bebba67 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@appbaseio/enterprise-search-ui": "latest",
- "@appbaseio/reactivesearch": "3.42.1",
+ "@appbaseio/reactivesearch": "^4.0.0",
"@emotion/core": "^10.0.35",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
diff --git a/src/components/Filters.js b/src/components/Filters.js
index 85e0fee..7312140 100644
--- a/src/components/Filters.js
+++ b/src/components/Filters.js
@@ -4,7 +4,10 @@ import React from 'react';
import { css, jsx } from '@emotion/core';
import get from 'lodash.get';
import { Collapse } from 'antd';
-import { componentTypes, ReactiveComponent } from '@appbaseio/reactivesearch';
+import {
+ componentTypes,
+ ReactiveComponentPrivate as ReactiveComponent,
+} from '@appbaseio/reactivesearch';
import createDOMPurify from 'dompurify';
import { getReactDependenciesFromPreferences, staticFacetsIds } from '../utils';
import { mediaMax } from '../utils/media';
diff --git a/src/components/Search.js b/src/components/Search.js
index 2280842..7558f73 100644
--- a/src/components/Search.js
+++ b/src/components/Search.js
@@ -5,8 +5,9 @@ import React, { Component } from 'react';
import {
ReactiveBase,
SelectedFilters,
- ReactiveComponent,
+ ReactiveComponentPrivate as ReactiveComponent,
componentTypes,
+ AIAnswer,
} from '@appbaseio/reactivesearch';
import get from 'lodash.get';
import { string, bool } from 'prop-types';
@@ -306,8 +307,9 @@ class Search extends Component {
defaultPreferences.resultSettings.rsConfig.infiniteScroll,
)
) {
- const containerCollection =
- document.getElementsByClassName('ant-modal');
+ const containerCollection = document.getElementsByClassName(
+ 'ant-modal',
+ );
if (containerCollection && containerCollection.length > 0) {
// eslint-disable-next-line
@@ -548,8 +550,7 @@ class Search extends Component {
url={this.url}
credentials={this.credentials}
theme={this.theme}
- enableAppbase
- appbaseConfig={{
+ reactivesearchAPIConfig={{
recordAnalytics: true,
...userIdObj,
}}
@@ -699,6 +700,15 @@ class Search extends Component {
) : null}
+ {this.resultSettings.showAIAnswer ? (
+
+ ) : null}
+