Skip to content

Add Zoekt search syntax documentation link

Dmitry Gruzd requested to merge 389946-add-search-syntax-docs into master

What does this MR do and why?

This is a follow-up from !109345 (comment 1257324896), which adds documentation link to Zoekt syntax when we encounter an error.

This MR also adds a Syntax section to the exact code search documentation page to make linking it easier. As we roll out Zoekt, we're going to add more examples and expand this section.

Screenshots or screen recordings

before after
SCR-20230331-ili SCR-20230331-ilj

How to set up and validate locally

  1. Add these lines to your gdk.yml
zoekt:
  enabled: true
  1. Execute gdk reconfigure
  2. Run these commands in you rails console to add the flightjs namespace to Zoekt
::Feature.enable(:index_code_with_zoekt)
::Feature.enable(:search_code_with_zoekt)
zoekt_shard = ::Zoekt::Shard.find_or_create_by!(index_base_url: 'http://127.0.0.1:6080/', search_base_url: 'http://127.0.0.1:6090/')
namespace = Namespace.find_by_full_path("flightjs") # Some namespace you want to enable
::Zoekt::IndexedNamespace.find_or_create_by!(shard: zoekt_shard, namespace: namespace.root_ancestor)
  1. Change the visibility of the flightjs project to public
  2. Make code changes to any project in the namespace you indexed to ensure the index gets updated
  3. Perform search in a project inside the flightjs namespace using * as a term.
  4. You should see the error page with the documentation link

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #389946 (closed)

Edited by Dmitry Gruzd

Merge request reports