├── .nvmrc ├── .husky ├── .gitignore └── pre-commit ├── .npmrc ├── .prettierrc ├── CODEOWNERS ├── packages ├── search-ui │ ├── .npmrc │ ├── src │ │ ├── constants.ts │ │ ├── test │ │ │ ├── setupTests.js │ │ │ └── sharedTests.js │ │ ├── __tests__ │ │ │ ├── A11yNotifications.ssr.test.ts │ │ │ ├── actions │ │ │ │ └── trackAutocompleteSuggestionClickThrough.test.ts │ │ │ └── A11yNotifications.test.ts │ │ ├── actions │ │ │ ├── reset.ts │ │ │ ├── setCurrent.ts │ │ │ ├── setResultsPerPage.ts │ │ │ ├── clearFilters.ts │ │ │ ├── setSort.ts │ │ │ ├── a11yNotify.ts │ │ │ ├── trackAutocompleteSuggestionClickThrough.ts │ │ │ ├── setFilter.ts │ │ │ ├── removeFilter.ts │ │ │ ├── trackClickThrough.ts │ │ │ └── trackAutocompleteClickThrough.ts │ │ ├── index.ts │ │ ├── queryString.ts │ │ ├── RequestSequencer.ts │ │ └── preserveTypesEncoder.ts │ ├── NOTICE.txt │ ├── tsconfig.json │ ├── jest.config.js │ └── package.json ├── react-search-ui │ ├── .npmrc │ ├── __mocks__ │ │ └── styleMock.js │ ├── src │ │ ├── hooks │ │ │ └── index.ts │ │ ├── containers │ │ │ ├── __tests__ │ │ │ │ └── __snapshots__ │ │ │ │ │ ├── Result.test.tsx.snap │ │ │ │ │ ├── Paging.test.tsx.snap │ │ │ │ │ ├── SearchBox.test.tsx.snap │ │ │ │ │ ├── Sorting.test.tsx.snap │ │ │ │ │ ├── ErrorBoundary.test.tsx.snap │ │ │ │ │ ├── PagingInfo.test.tsx.snap │ │ │ │ │ ├── Facet.test.tsx.snap │ │ │ │ │ ├── Results.test.tsx.snap │ │ │ │ │ └── ResultsPerPage.test.tsx.snap │ │ │ ├── index.ts │ │ │ ├── Paging.tsx │ │ │ ├── PagingInfo.tsx │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── ResultsPerPage.tsx │ │ │ ├── Result.tsx │ │ │ └── Results.tsx │ │ ├── setupTests.js │ │ ├── SearchContext.ts │ │ ├── helpers.ts │ │ ├── index.ts │ │ ├── A11yNotifications.ts │ │ ├── __tests__ │ │ │ ├── A11yNotifications.test.ts │ │ │ ├── helpers.test.ts │ │ │ └── SearchContext.test.tsx │ │ ├── WithSearchRenderProps.tsx │ │ └── types │ │ │ └── index.ts │ ├── NOTICE.txt │ ├── tsup.config.ts │ ├── tsconfig.json │ ├── README.md │ ├── jest.config.js │ └── package.json ├── react-search-ui-views │ ├── .npmrc │ ├── __mocks__ │ │ └── styleMock.js │ ├── src │ │ ├── layouts │ │ │ ├── index.ts │ │ │ ├── Layout.tsx │ │ │ └── LayoutSidebar.tsx │ │ ├── styles │ │ │ ├── styles.scss │ │ │ └── themes │ │ │ │ └── reference-ui │ │ │ │ ├── components │ │ │ │ ├── _results-container.scss │ │ │ │ ├── _paging-info.scss │ │ │ │ ├── _sorting.scss │ │ │ │ ├── _results-per-page.scss │ │ │ │ ├── _error-boundary.scss │ │ │ │ ├── _boolean-facet.scss │ │ │ │ ├── _facets.scss │ │ │ │ ├── _paging.scss │ │ │ │ ├── _single-links-facet.scss │ │ │ │ └── _multi-checkbox-facet.scss │ │ │ │ ├── _base.scss │ │ │ │ └── modules │ │ │ │ ├── _mixins.scss │ │ │ │ └── _variables.scss │ │ ├── __tests__ │ │ │ ├── __snapshots__ │ │ │ │ ├── Facets.test.tsx.snap │ │ │ │ ├── Results.test.tsx.snap │ │ │ │ ├── ErrorBoundary.test.tsx.snap │ │ │ │ ├── PagingInfo.test.tsx.snap │ │ │ │ ├── Paging.test.tsx.snap │ │ │ │ ├── BooleanFacet.test.tsx.snap │ │ │ │ └── SearchBox.test.tsx.snap │ │ │ ├── layouts │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── LayoutSidebar.test.tsx.snap │ │ │ │ ├── LayoutSidebar.test.tsx │ │ │ │ └── Layout.test.tsx │ │ │ ├── view-helpers │ │ │ │ └── appendClassName.test.ts │ │ │ ├── Facets.test.tsx │ │ │ ├── Results.test.tsx │ │ │ ├── PagingInfo.test.tsx │ │ │ ├── Paging.test.tsx │ │ │ ├── ResultsPerPage.test.tsx │ │ │ ├── ErrorBoundary.test.tsx │ │ │ └── Sorting.test.tsx │ │ ├── view-helpers │ │ │ ├── index.ts │ │ │ ├── getFilterValueDisplay.ts │ │ │ ├── appendClassName.ts │ │ │ └── getUrlSanitizer.ts │ │ ├── Facets.tsx │ │ ├── setupTests.js │ │ ├── SearchInput.tsx │ │ ├── ErrorBoundary.tsx │ │ ├── index.tsx │ │ ├── Results.tsx │ │ ├── Paging.tsx │ │ └── PagingInfo.tsx │ ├── NOTICE.txt │ ├── .storybook │ │ ├── addons.js │ │ └── config.js │ ├── postcss.config.js │ ├── tsconfig.json │ ├── jest.config.js │ ├── tsup.config.ts │ └── README.md ├── search-ui-analytics-plugin │ ├── .npmrc │ ├── NOTICE.txt │ ├── jest.config.js │ ├── tsconfig.json │ └── package.json ├── search-ui-app-search-connector │ ├── .npmrc │ ├── src │ │ ├── index.ts │ │ └── buildResponseAdapterOptions.ts │ ├── NOTICE.txt │ ├── bin │ │ ├── watch-js │ │ └── build-js │ ├── jest.config.js │ ├── tsconfig-cjs.json │ ├── tsconfig.json │ └── package.json ├── search-ui-site-search-connector │ ├── .npmrc │ ├── src │ │ ├── index.ts │ │ ├── responseAdapter.ts │ │ ├── request.ts │ │ ├── types │ │ │ └── index.ts │ │ ├── responseAdapters.ts │ │ └── __tests__ │ │ │ └── example-response.json │ ├── NOTICE.txt │ ├── jest.config.js │ ├── tsconfig.json │ └── package.json ├── search-ui-workplace-search-connector │ ├── .npmrc │ ├── src │ │ ├── index.ts │ │ └── buildResponseAdapterOptions.ts │ ├── NOTICE.txt │ ├── bin │ │ ├── watch-js │ │ └── build-js │ ├── tsconfig-cjs.json │ ├── jest.config.js │ └── tsconfig.json ├── search-ui-engines-connector │ ├── NOTICE.txt │ ├── bin │ │ ├── watch-js │ │ └── build-js │ ├── jest.config.js │ ├── tsconfig.json │ ├── src │ │ ├── handlers │ │ │ ├── SearchkitModule.ts │ │ │ ├── search │ │ │ │ ├── Query.ts │ │ │ │ └── Response.ts │ │ │ ├── transporter.ts │ │ │ ├── common.ts │ │ │ └── __test__ │ │ │ │ └── transporter.test.ts │ │ └── types.ts │ └── README.md └── search-ui-elasticsearch-connector │ ├── NOTICE.txt │ ├── src │ ├── api-proxy.ts │ ├── index.ts │ ├── __tests__ │ │ ├── index.test.ts │ │ ├── utils.test.ts │ │ └── utils.test.node.ts │ ├── handlers │ │ └── handleSearch.ts │ ├── queryBuilders │ │ ├── __tests__ │ │ │ └── BaseQueryBuilder.test.ts │ │ └── SuggestionsAutocompleteBuilder.ts │ └── types.ts │ ├── tsup.config.ts │ ├── tsconfig.json │ ├── jest.config.js │ └── jest.node.config.js ├── NOTICE.txt ├── docs ├── images │ ├── screenshot.png │ ├── ecommerce │ │ ├── carousel │ │ │ └── carousel.png │ │ ├── overview │ │ │ └── overview.png │ │ ├── category-page │ │ │ ├── facets.png │ │ │ ├── sorting.png │ │ │ ├── facet-views.png │ │ │ └── category-page.png │ │ ├── autocomplete │ │ │ ├── query-results-es-shop.png │ │ │ ├── query-suggestions-amazon.png │ │ │ ├── federated-search-products.png │ │ │ ├── query-suggestions-es-shop.png │ │ │ ├── query-suggestions-multiple-sources.png │ │ │ └── query-suggestions-popular-queries.png │ │ └── product-detail-page │ │ │ ├── product-detail-page.png │ │ │ └── cross-sell-recommendations.png │ ├── app-search-tutorial │ │ ├── completed-ui.png │ │ ├── credentials.png │ │ ├── initial-cra.png │ │ ├── kibana-home.png │ │ ├── create-engine.png │ │ ├── ent-search-home.png │ │ ├── paste-json-data.png │ │ └── configure-schema.png │ ├── elasticsearch-tutorial │ │ ├── api-keys.jpeg │ │ ├── search-ui.jpeg │ │ ├── api-key-view.jpeg │ │ ├── copy-cloud-id.jpg │ │ ├── cors-settings.png │ │ ├── create-index.jpeg │ │ ├── edit-settings.png │ │ ├── copy-es-endpoint.jpeg │ │ └── update-mapping.jpeg │ ├── workplace-search-tutorial │ │ ├── authorize.png │ │ ├── endpoints.png │ │ ├── oauth-application.png │ │ └── search-ui-results.png │ └── guides-analyzing-performance │ │ ├── dashboard.png │ │ ├── server-status.png │ │ ├── events-request.png │ │ └── integrations-server.png ├── reference │ ├── images │ │ ├── facets.png │ │ ├── sorting.png │ │ ├── api-keys.jpeg │ │ ├── authorize.png │ │ ├── carousel.png │ │ ├── dashboard.png │ │ ├── endpoints.png │ │ ├── search-ui.jpeg │ │ ├── completed-ui.png │ │ ├── credentials.png │ │ ├── facet-views.png │ │ ├── initial-cra.png │ │ ├── kibana-home.png │ │ ├── api-key-view.jpeg │ │ ├── category-page.png │ │ ├── copy-cloud-id.jpg │ │ ├── cors-settings.png │ │ ├── create-engine.png │ │ ├── create-index.jpeg │ │ ├── edit-settings.png │ │ ├── ent-search-home.png │ │ ├── events-request.png │ │ ├── server-status.png │ │ ├── update-mapping.jpeg │ │ ├── configure-schema.png │ │ ├── oauth-application.png │ │ ├── search-ui-results.png │ │ ├── integrations-server.png │ │ ├── product-detail-page.png │ │ ├── query-results-es-shop.png │ │ ├── federated-search-products.png │ │ ├── query-suggestions-amazon.png │ │ ├── query-suggestions-es-shop.png │ │ ├── cross-sell-recommendations.png │ │ ├── query-suggestions-multiple-sources.png │ │ └── query-suggestions-popular-queries.png │ ├── known-issues.md │ ├── guides-debugging.md │ ├── api-react-use-search.md │ ├── guides-using-search-as-you-type.md │ ├── guides-adding-search-bar-to-header.md │ ├── advanced-usage.md │ ├── tutorials.md │ ├── solutions-ecommerce-product-detail-page.md │ └── api-core-index.md ├── docset.yml └── README.md ├── examples ├── vue │ ├── public │ │ └── favicon.ico │ ├── .vscode │ │ └── extensions.json │ ├── src │ │ ├── main.js │ │ ├── data │ │ │ └── README.md │ │ ├── assets │ │ │ └── logo.svg │ │ ├── components │ │ │ ├── SearchSort.vue │ │ │ ├── SearchResultsPerPage.vue │ │ │ ├── SearchResults.vue │ │ │ ├── SearchPagingInfo.vue │ │ │ ├── SearchHeader.vue │ │ │ └── SearchFacet.vue │ │ ├── App.vue │ │ └── searchConfig.js │ ├── .eslintrc.cjs │ ├── index.html │ ├── vite.config.js │ ├── .gitignore │ ├── README.md │ ├── cleanseCards.js │ └── package.json └── sandbox │ ├── public │ └── favicon.png │ ├── postcss.config.cjs │ ├── tailwind.config.js │ ├── src │ ├── components │ │ ├── ExampleCard.tsx │ │ ├── UseCaseCard.tsx │ │ ├── ApiCard.tsx │ │ └── TabTrigger.tsx │ ├── main.tsx │ ├── pages │ │ ├── search-bar-in-header │ │ │ ├── index.jsx │ │ │ └── Header.jsx │ │ ├── customizing-styles-and-html │ │ │ ├── ClearFilters.jsx │ │ │ └── custom.css │ │ └── ecommerce │ │ │ ├── styles.scss │ │ │ ├── components │ │ │ └── ProductCarousel │ │ │ │ ├── config.js │ │ │ │ └── index.jsx │ │ │ └── index.jsx │ └── styles.css │ ├── vite.config.js │ ├── .gitignore │ ├── tsconfig.json │ ├── index.html │ ├── .codesandbox │ └── tasks.json │ └── eslint.config.js ├── .vscode └── settings.json ├── .ci ├── jobs │ ├── defaults.yml │ ├── searchui.yml │ └── search-ui.yml └── pipelines │ ├── searchui.groovy │ └── search-ui.groovy ├── .gitignore ├── .github ├── workflows │ ├── docs-cleanup.yml │ ├── docs-build.yml │ └── docs-preview.yml └── ISSUE_TEMPLATE │ ├── question.md │ ├── feature_request.md │ └── bug_report.md ├── SECURITY.txt ├── tsconfig.base.json ├── tsup.config.ts ├── pull_request_template.md ├── lerna.json ├── .eslintrc.js └── .circleci └── config.yml /.nvmrc: -------------------------------------------------------------------------------- 1 | 20.16.0 -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "none" 3 | } 4 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @elastic/search-experiences-team 2 | -------------------------------------------------------------------------------- /packages/search-ui/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /packages/react-search-ui/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /packages/react-search-ui-views/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /packages/search-ui-analytics-plugin/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /packages/react-search-ui/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /packages/search-ui-site-search-connector/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /packages/react-search-ui-views/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/react-search-ui/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export { useSearch } from "./useSearch"; 2 | -------------------------------------------------------------------------------- /packages/search-ui/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const INVALID_CREDENTIALS = "Invalid credentials"; 2 | -------------------------------------------------------------------------------- /packages/react-search-ui-views/src/layouts/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Layout } from "./Layout"; 2 | -------------------------------------------------------------------------------- /packages/search-ui/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /docs/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/screenshot.png -------------------------------------------------------------------------------- /packages/react-search-ui/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./AppSearchAPIConnector"; 2 | -------------------------------------------------------------------------------- /packages/react-search-ui-views/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/search-ui-site-search-connector/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./SiteSearchAPIConnector"; 2 | -------------------------------------------------------------------------------- /examples/vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/examples/vue/public/favicon.ico -------------------------------------------------------------------------------- /packages/search-ui-analytics-plugin/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/search-ui-engines-connector/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /docs/reference/images/facets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/facets.png -------------------------------------------------------------------------------- /docs/reference/images/sorting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/sorting.png -------------------------------------------------------------------------------- /examples/vue/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/react-search-ui-views/src/styles/styles.scss: -------------------------------------------------------------------------------- 1 | // Reference UI Theme 2 | @import "themes/reference-ui/base"; 3 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/search-ui-site-search-connector/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./WorkplaceSearchAPIConnector"; 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "editor.formatOnSave": true 4 | } 5 | -------------------------------------------------------------------------------- /docs/reference/images/api-keys.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/api-keys.jpeg -------------------------------------------------------------------------------- /docs/reference/images/authorize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/authorize.png -------------------------------------------------------------------------------- /docs/reference/images/carousel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/carousel.png -------------------------------------------------------------------------------- /docs/reference/images/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/dashboard.png -------------------------------------------------------------------------------- /docs/reference/images/endpoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/endpoints.png -------------------------------------------------------------------------------- /docs/reference/images/search-ui.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/search-ui.jpeg -------------------------------------------------------------------------------- /examples/sandbox/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/examples/sandbox/public/favicon.png -------------------------------------------------------------------------------- /packages/search-ui-elasticsearch-connector/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Elastic Search UI. 2 | 3 | Copyright 2012-2019 Elasticsearch B.V. 4 | -------------------------------------------------------------------------------- /docs/reference/images/completed-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/completed-ui.png -------------------------------------------------------------------------------- /docs/reference/images/credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/credentials.png -------------------------------------------------------------------------------- /docs/reference/images/facet-views.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/facet-views.png -------------------------------------------------------------------------------- /docs/reference/images/initial-cra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/initial-cra.png -------------------------------------------------------------------------------- /docs/reference/images/kibana-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/kibana-home.png -------------------------------------------------------------------------------- /examples/vue/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import App from "./App.vue"; 3 | 4 | createApp(App).mount("#app"); 5 | -------------------------------------------------------------------------------- /docs/reference/images/api-key-view.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/api-key-view.jpeg -------------------------------------------------------------------------------- /docs/reference/images/category-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/category-page.png -------------------------------------------------------------------------------- /docs/reference/images/copy-cloud-id.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/copy-cloud-id.jpg -------------------------------------------------------------------------------- /docs/reference/images/cors-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/cors-settings.png -------------------------------------------------------------------------------- /docs/reference/images/create-engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/create-engine.png -------------------------------------------------------------------------------- /docs/reference/images/create-index.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/create-index.jpeg -------------------------------------------------------------------------------- /docs/reference/images/edit-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/edit-settings.png -------------------------------------------------------------------------------- /docs/reference/images/ent-search-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/ent-search-home.png -------------------------------------------------------------------------------- /docs/reference/images/events-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/events-request.png -------------------------------------------------------------------------------- /docs/reference/images/server-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/server-status.png -------------------------------------------------------------------------------- /docs/reference/images/update-mapping.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/update-mapping.jpeg -------------------------------------------------------------------------------- /docs/images/ecommerce/carousel/carousel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/carousel/carousel.png -------------------------------------------------------------------------------- /docs/images/ecommerce/overview/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/overview/overview.png -------------------------------------------------------------------------------- /docs/reference/images/configure-schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/configure-schema.png -------------------------------------------------------------------------------- /docs/reference/images/oauth-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/oauth-application.png -------------------------------------------------------------------------------- /docs/reference/images/search-ui-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/search-ui-results.png -------------------------------------------------------------------------------- /examples/sandbox/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/search-ui-engines-connector/bin/watch-js: -------------------------------------------------------------------------------- 1 | ./node_modules/.bin/tsc --watch & 2 | ./node_modules/.bin/tsc -p tsconfig-cjs.json --watch & -------------------------------------------------------------------------------- /docs/images/ecommerce/category-page/facets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/category-page/facets.png -------------------------------------------------------------------------------- /docs/reference/images/integrations-server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/integrations-server.png -------------------------------------------------------------------------------- /docs/reference/images/product-detail-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/product-detail-page.png -------------------------------------------------------------------------------- /packages/react-search-ui-views/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import "@storybook/addon-actions/register"; 2 | import "@storybook/addon-links/register"; 3 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/bin/watch-js: -------------------------------------------------------------------------------- 1 | ./node_modules/.bin/tsc --watch & 2 | ./node_modules/.bin/tsc -p tsconfig-cjs.json --watch & -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/completed-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/completed-ui.png -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/credentials.png -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/initial-cra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/initial-cra.png -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/kibana-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/kibana-home.png -------------------------------------------------------------------------------- /docs/images/ecommerce/category-page/sorting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/category-page/sorting.png -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/api-keys.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/api-keys.jpeg -------------------------------------------------------------------------------- /docs/reference/images/query-results-es-shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/query-results-es-shop.png -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/bin/watch-js: -------------------------------------------------------------------------------- 1 | ./node_modules/.bin/tsc --watch & 2 | ./node_modules/.bin/tsc -p tsconfig-cjs.json --watch & -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/create-engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/create-engine.png -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/ent-search-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/ent-search-home.png -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/paste-json-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/paste-json-data.png -------------------------------------------------------------------------------- /docs/images/ecommerce/category-page/facet-views.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/category-page/facet-views.png -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/search-ui.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/search-ui.jpeg -------------------------------------------------------------------------------- /docs/images/workplace-search-tutorial/authorize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/workplace-search-tutorial/authorize.png -------------------------------------------------------------------------------- /docs/images/workplace-search-tutorial/endpoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/workplace-search-tutorial/endpoints.png -------------------------------------------------------------------------------- /docs/reference/images/federated-search-products.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/federated-search-products.png -------------------------------------------------------------------------------- /docs/reference/images/query-suggestions-amazon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/query-suggestions-amazon.png -------------------------------------------------------------------------------- /docs/reference/images/query-suggestions-es-shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/query-suggestions-es-shop.png -------------------------------------------------------------------------------- /packages/search-ui/src/test/setupTests.js: -------------------------------------------------------------------------------- 1 | // We use fake timers to avoid having to use async programming 2 | // in our tests. 3 | jest.useFakeTimers(); 4 | -------------------------------------------------------------------------------- /docs/images/app-search-tutorial/configure-schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/app-search-tutorial/configure-schema.png -------------------------------------------------------------------------------- /docs/images/ecommerce/category-page/category-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/category-page/category-page.png -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/api-key-view.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/api-key-view.jpeg -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/copy-cloud-id.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/copy-cloud-id.jpg -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/cors-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/cors-settings.png -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/create-index.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/create-index.jpeg -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/edit-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/edit-settings.png -------------------------------------------------------------------------------- /docs/reference/images/cross-sell-recommendations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/cross-sell-recommendations.png -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/copy-es-endpoint.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/copy-es-endpoint.jpeg -------------------------------------------------------------------------------- /docs/images/elasticsearch-tutorial/update-mapping.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/elasticsearch-tutorial/update-mapping.jpeg -------------------------------------------------------------------------------- /docs/images/guides-analyzing-performance/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/guides-analyzing-performance/dashboard.png -------------------------------------------------------------------------------- /docs/images/guides-analyzing-performance/server-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/guides-analyzing-performance/server-status.png -------------------------------------------------------------------------------- /examples/sandbox/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ["./src/**/*.{js,jsx,ts,tsx}"], 3 | theme: { 4 | extend: {} 5 | }, 6 | plugins: [] 7 | }; 8 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "ts-jest/presets/js-with-ts-esm", 3 | testPathIgnorePatterns: ["./lib"] 4 | }; 5 | -------------------------------------------------------------------------------- /packages/search-ui-elasticsearch-connector/src/api-proxy.ts: -------------------------------------------------------------------------------- 1 | export * from "./types"; 2 | export { default as ApiProxyConnector } from "./connectors/ApiProxyConnector"; 3 | -------------------------------------------------------------------------------- /packages/search-ui-site-search-connector/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "ts-jest/presets/js-with-ts-esm", 3 | testPathIgnorePatterns: ["./lib"] 4 | }; 5 | -------------------------------------------------------------------------------- /docs/images/ecommerce/autocomplete/query-results-es-shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/autocomplete/query-results-es-shop.png -------------------------------------------------------------------------------- /docs/images/guides-analyzing-performance/events-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/guides-analyzing-performance/events-request.png -------------------------------------------------------------------------------- /docs/images/workplace-search-tutorial/oauth-application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/workplace-search-tutorial/oauth-application.png -------------------------------------------------------------------------------- /docs/images/workplace-search-tutorial/search-ui-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/workplace-search-tutorial/search-ui-results.png -------------------------------------------------------------------------------- /docs/reference/images/query-suggestions-multiple-sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/query-suggestions-multiple-sources.png -------------------------------------------------------------------------------- /docs/reference/images/query-suggestions-popular-queries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/reference/images/query-suggestions-popular-queries.png -------------------------------------------------------------------------------- /docs/images/ecommerce/autocomplete/query-suggestions-amazon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/autocomplete/query-suggestions-amazon.png -------------------------------------------------------------------------------- /packages/react-search-ui/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import baseConfig from "../../tsup.config.ts"; 2 | 3 | export default { 4 | ...baseConfig, 5 | external: ["react", "react-dom"] 6 | }; 7 | -------------------------------------------------------------------------------- /docs/images/ecommerce/autocomplete/federated-search-products.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/autocomplete/federated-search-products.png -------------------------------------------------------------------------------- /docs/images/ecommerce/autocomplete/query-suggestions-es-shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/autocomplete/query-suggestions-es-shop.png -------------------------------------------------------------------------------- /docs/images/ecommerce/product-detail-page/product-detail-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/product-detail-page/product-detail-page.png -------------------------------------------------------------------------------- /docs/images/guides-analyzing-performance/integrations-server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/guides-analyzing-performance/integrations-server.png -------------------------------------------------------------------------------- /packages/react-search-ui-views/src/styles/themes/reference-ui/components/_results-container.scss: -------------------------------------------------------------------------------- 1 | @include block("results-container") { 2 | padding: 0; 3 | list-style: none; 4 | } 5 | -------------------------------------------------------------------------------- /packages/react-search-ui/src/containers/__tests__/__snapshots__/Result.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`supports a render prop 1`] = `
`; 4 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/bin/build-js: -------------------------------------------------------------------------------- 1 | # Builds ESM JavaScript 2 | ./node_modules/.bin/tsc 3 | 4 | # Builds CJS JavaScript 5 | ./node_modules/.bin/tsc -p tsconfig-cjs.json 6 | -------------------------------------------------------------------------------- /.ci/jobs/defaults.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - meta: 3 | cluster: devops-ci 4 | 5 | - job: 6 | node: "linux && immutable" 7 | 8 | wrappers: 9 | - ansicolor 10 | - timestamps 11 | -------------------------------------------------------------------------------- /docs/docset.yml: -------------------------------------------------------------------------------- 1 | project: "Search UI docs" 2 | exclude: 3 | - README.md 4 | cross_links: 5 | - apm-agent-rum-js 6 | - docs-content 7 | - elasticsearch 8 | toc: 9 | - toc: reference 10 | -------------------------------------------------------------------------------- /docs/images/ecommerce/autocomplete/query-suggestions-multiple-sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/autocomplete/query-suggestions-multiple-sources.png -------------------------------------------------------------------------------- /docs/images/ecommerce/autocomplete/query-suggestions-popular-queries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/autocomplete/query-suggestions-popular-queries.png -------------------------------------------------------------------------------- /docs/images/ecommerce/product-detail-page/cross-sell-recommendations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LRenzo0801/search-ui/HEAD/docs/images/ecommerce/product-detail-page/cross-sell-recommendations.png -------------------------------------------------------------------------------- /packages/search-ui-analytics-plugin/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "ts-jest/presets/js-with-ts-esm", 3 | testPathIgnorePatterns: ["./lib"], 4 | testEnvironment: "jsdom" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/search-ui-app-search-connector/tsconfig-cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "CommonJS", 5 | "outDir": "./lib/cjs" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/search-ui-engines-connector/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "ts-jest/presets/js-with-ts-esm", 3 | testPathIgnorePatterns: ["./lib"], 4 | testEnvironment: "jsdom" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/bin/build-js: -------------------------------------------------------------------------------- 1 | # Builds ESM JavaScript 2 | ./node_modules/.bin/tsc 3 | 4 | # Builds CJS JavaScript 5 | ./node_modules/.bin/tsc -p tsconfig-cjs.json 6 | -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/tsconfig-cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "CommonJS", 5 | "outDir": "./lib/cjs" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lerna-debug.log 3 | storybook-static 4 | .idea 5 | .env 6 | package-lock.json 7 | packages/**/src/version.ts 8 | packages/**/lib/* 9 | coverage 10 | html_docs 11 | dist 12 | -------------------------------------------------------------------------------- /packages/react-search-ui/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // setup file 2 | import { configure } from "enzyme"; 3 | import Adapter from "@cfaester/enzyme-adapter-react-18"; 4 | 5 | configure({ adapter: new Adapter() }); 6 | -------------------------------------------------------------------------------- /packages/search-ui-engines-connector/bin/build-js: -------------------------------------------------------------------------------- 1 | # clear directory 2 | # Builds ESM JavaScript 3 | ./node_modules/.bin/tsc 4 | 5 | # Builds CJS JavaScript 6 | ./node_modules/.bin/tsc -p tsconfig-cjs.json 7 | -------------------------------------------------------------------------------- /packages/search-ui-workplace-search-connector/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "ts-jest/presets/js-with-ts-esm", 3 | testEnvironment: "jsdom", 4 | testPathIgnorePatterns: ["./lib"] 5 | }; 6 | -------------------------------------------------------------------------------- /packages/react-search-ui/src/containers/__tests__/__snapshots__/Paging.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`supports a render prop 1`] = ` 4 |
12 |
--------------------------------------------------------------------------------
/packages/react-search-ui/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | preset: "ts-jest/presets/js-with-ts-esm",
3 | testPathIgnorePatterns: ["./lib"],
4 | testEnvironment: "jsdom",
5 | setupFilesAfterEnv: ["Options](#Options) |
32 |
33 | ## Options
34 |
35 | **Kind**: global typedef
36 |
37 | | Param | Type | Default | Description |
38 | | ---------- | ------------------- | ------- | --------------------------------------------------------------- |
39 | | host | string | | Engines Host. |
40 | | engineName | string | | The name of the engine to search |
41 | | apiKey | string | | API Key for the engine. Can be found within the Engine view UI. |
42 |
43 | ## Query Configuration Requirements
44 |
45 | - `search_fields` object is required with all fields you want to search by.
46 |
--------------------------------------------------------------------------------
/packages/search-ui/src/actions/trackAutocompleteClickThrough.ts:
--------------------------------------------------------------------------------
1 | import Events from "../Events";
2 |
3 | /**
4 | * Report a click through event. A click through event is when a user
5 | * clicks on a result within an autocomplete Dropdown.
6 | *
7 | * @param documentId String The document ID associated with result that was
8 | * clicked
9 | * @param tag Array[String] Optional Tags which can be used to categorize
10 | * this click event
11 | */
12 | export default function trackAutocompleteClickThrough(
13 | documentId: string,
14 | tags: string[] = []
15 | ): void {
16 | if (this.debug) {
17 | // eslint-disable-next-line no-console
18 | console.log(
19 | "Search UI: Action",
20 | "trackAutocompleteClickThrough",
21 | ...arguments
22 | );
23 | }
24 |
25 | const {
26 | autocompletedResultsRequestId,
27 | searchTerm,
28 | autocompletedResults,
29 | current,
30 | resultsPerPage,
31 | totalResults,
32 | filters
33 | } = this.state;
34 | const resultIndex = autocompletedResults.findIndex(
35 | (result) => result._meta.id === documentId
36 | );
37 | const result = autocompletedResults[resultIndex];
38 |
39 | const events: Events = this.events;
40 |
41 | events.autocompleteResultClick({
42 | query: searchTerm,
43 | documentId,
44 | requestId: autocompletedResultsRequestId,
45 | tags,
46 | result,
47 | resultIndex
48 | });
49 |
50 | events.emit({
51 | type: "ResultSelected",
52 | documentId,
53 | query: searchTerm,
54 | position: resultIndex,
55 | origin: "autocomplete",
56 | tags,
57 | totalResults,
58 | filters,
59 | currentPage: current,
60 | resultsPerPage: resultsPerPage
61 | });
62 | }
63 |
--------------------------------------------------------------------------------
/packages/search-ui-site-search-connector/src/__tests__/example-response.json:
--------------------------------------------------------------------------------
1 | {
2 | "record_count": 2,
3 | "records": {
4 | "national-parks": [
5 | {
6 | "nps_link": "https://www.nps.gov/acad/index.htm",
7 | "updated_at": "2018-11-13T21:51:11+00:00",
8 | "states": ["Maine"],
9 | "title": "Acadia",
10 | "external_id": "9000",
11 | "acres": 49057.36,
12 | "_index": "5beb4099c9f929367efa5b7d",
13 | "_type": "5beb4099c9f929367efa5b7c",
14 | "_score": 0.7048211,
15 | "_version": null,
16 | "_explanation": null,
17 | "sort": null,
18 | "highlight": {
19 | "title": "Acadia"
20 | },
21 | "id": "5beb474f8db2315427beecc7"
22 | },
23 | {
24 | "nps_link": "https://www.nps.gov/acad/index.htm",
25 | "title": "Acadia",
26 | "updated_at": "2018-11-13T21:52:56+00:00",
27 | "states": ["Maine"],
28 | "external_id": "0",
29 | "acres": 49057.36,
30 | "_index": "5beb4099c9f929367efa5b7d",
31 | "_type": "5beb4099c9f929367efa5b7c",
32 | "_score": 0.7048211,
33 | "_version": null,
34 | "_explanation": null,
35 | "sort": null,
36 | "highlight": {
37 | "title": "Acadia"
38 | },
39 | "id": "5beb47b8a1f2532eb09be102"
40 | }
41 | ]
42 | },
43 | "info": {
44 | "national-parks": {
45 | "query": "acadia",
46 | "current_page": 1,
47 | "num_pages": 1,
48 | "per_page": 20,
49 | "total_result_count": 2,
50 | "facets": {
51 | "states": {
52 | "Maine": 2
53 | }
54 | }
55 | }
56 | },
57 | "errors": {}
58 | }
59 |
--------------------------------------------------------------------------------