Skip to content

Commit

Permalink
Don't load datahub
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Apr 28, 2022
1 parent c4281f4 commit e411ab9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
10 changes: 7 additions & 3 deletions src/SearchBlock/SearchBlockView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ export default function SearchBlockView(props) {
registry.searchui[appName] = {
...registry.searchui[appName],
requestParams: {
params: {
index: data.rawIndex,
},
...(data.rawIndex
? {
params: {
index: data.rawIndex,
},
}
: {}),
},
};

Expand Down
24 changes: 12 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'regenerator-runtime/runtime'; // compatibility with react-speech-recognition

import installGlobalsearch from '@eeacms/globalsearch';
import installDatahub from '@eeacms/datahub';
// import installDatahub from '@eeacms/datahub';
import { registry } from '@eeacms/search';
import codeSVG from '@plone/volto/icons/code.svg';
import SearchBlockView from './SearchBlock/SearchBlockView';
Expand Down Expand Up @@ -67,15 +67,15 @@ export const installGlobalSearch = (config) => {
};

// TODO: this should be moved into its own volto addon
export const installDataHub = (config) => {
config.settings.searchlib = installDatahub(config.settings.searchlib);

const { datahub } = config.settings.searchlib.searchui;

// Tweak the searchlib config to use the middleware instead of the index
datahub.elastic_index = '_es/globalsearch';

return config;
};

// export const installDataHub = (config) => {
// config.settings.searchlib = installDatahub(config.settings.searchlib);
//
// const { datahub } = config.settings.searchlib.searchui;
//
// // Tweak the searchlib config to use the middleware instead of the index
// datahub.elastic_index = '_es/globalsearch';
//
// return config;
// };
//
export default applyConfig;

0 comments on commit e411ab9

Please sign in to comment.