You can develop and debug search results (homepage, the "Search for services" field) by running Insights Chrome together with chrome-service-backend.
- Have a go language setup. You can follow the gmv guide.
- Have a podman installed. Getting started guide
- Have the chrome-service-backend checkout locally.
- Make sure you terminal supports the Makefile utility.
chrome-service-backend is the bridge between kafka and the browser client. It exposes the search-index.json endpoint required for Chrome search to function.
- Follow the chrome-service-backend steps for local setup (
make dev-static
ormake dev-static-node
should be enough just to serve the static assets including search index). - You can request http://localhost:8000/api/chrome-service/v1/static/stable/stage/search/search-index.json (assuming you have left the default port settings) to test the connection and make sure that the chrome service is serving static assets.
- Follow the chrome-service-backend instructions to generate the search index as a JSON file (running
make generate-search-index
should be enough).
- Once your chrome service backend is running, start the chrome dev server with the chrome service config using this command:
NAV_CONFIG=8000 yarn dev
.
When all the steps are complete, you should be able to see the search results (https://stage.foo.redhat.com:1337, "Search for services") provided from the locally generated search index. Any subsequent update to search index must be followed with make generate-search-index
to regenerate the search index file.
You can enable additional logging of the search results when typing any prompt by editing levenshtein-search.ts and setting debugFlag
to true.