Skip to content

Commit

Permalink
Autoload results
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Dec 19, 2022
1 parent 27e91d0 commit c766959
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions searchlib/components/SearchApp/useSearchApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default function useSearchApp({
}),
[appConfig, onAutocomplete, onSearch, locationSearchTerm],
);
console.log('elastiConfig', elasticConfig);

const { facetOptions } = React.useState(useFacetsWithAllOptions(appConfig));

Expand Down
11 changes: 10 additions & 1 deletion src/SearchBlock/templates/SearchResultsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ export default function SearchResultsView(props) {
}

SearchResultsView.schemaEnhancer = ({ schema }) => {
schema.fieldsets[0].fields.unshift('defaultResultView');
schema.fieldsets[0].fields.unshift(
'defaultResultView',
'alwaysSearchOnInitialLoad',
);
schema.properties.alwaysSearchOnInitialLoad = {
title: 'Autoload results',
type: 'boolean',
default: true,
configPath: 'alwaysSearchOnInitialLoad',
};

return schema;
};

0 comments on commit c766959

Please sign in to comment.