Skip to content

Conversation

@kartben
Copy link
Contributor

@kartben kartben commented Oct 21, 2025

This implements a few improvements to make Kconfig search results more relevant:

  • A match in a symbol's name is given more weight than a match in its prompt.
  • Field-length normalization is applied so that the shorter the field, the higher its relevance (e.g. searching for "sensor" will now basically yield CONFIG_SENSOR as the top result as the query basically matches 100% of the symbol's name.

https://builds.zephyrproject.io/zephyr/pr/98016/docs/kconfig.html

I encourage folks to try out a few queries ("w1", "sensor", "tracing", ... are definitely huge improvements IMO) and confirm this is indeed an improvement.

This implements a few improvements to make Kconfig search results more
relevant:

- A match in a symbol's name is given more weight than a match in its
  prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will basically
  yield CONFIG_SENSOR as the top result as the query basically matches
  100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
@sonarqubecloud
Copy link

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, results are definitely better, good improvement!

@nordicjm
Copy link
Contributor

nordicjm commented Oct 22, 2025

Searching for retain has definitely improved but some nice ideas for the future are to give weight to CONFIG_<search>* first, in the one linked in the PR the Kconfigs are:

CONFIG_RETAINED_MEM
CONFIG_LOG_BACKEND_MQTT_RETAIN
CONFIG_PERCEPIO_DFM_CFG_COREDUMP_RETAIN
CONFIG_PERCEPIO_DFM_CFG_RETAINED_MEMORY
CONFIG_RETAINED_MEM_ZEPHYR_RAM
CONFIG_RETAINED_MEM_ZEPHYR_REG
CONFIG_RETAINED_MEM_INIT_PRIORITY
CONFIG_RETAINED_MEM_LOG_LEVEL_CHOICE
CONFIG_RETAINED_MEM_MUTEX_FORCE_DISABLE

etc. it would be nice if the percepio and log ones were places after all of the retained memory ones

EDIT: I guess you could also just search for CONFIG_RETAIN...

kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
kartben added a commit to kartben/zephyr that referenced this pull request Oct 23, 2025
This implements the same improved sorting algorithm as was recently
added to the documentation (see zephyrproject-rtos#98016),
namely:

- A match in a Kconfig symbol's name is given more weight than a match
  in its prompt.
- Field-length normalization is applied so that the shorter the field,
  the higher its relevance (e.g. searching for "sensor" will now
  basically yield CONFIG_SENSOR as the top result as the query basically
  matches 100% of the symbol's name.

Signed-off-by: Benjamin Cabé <[email protected]>
@cfriedt cfriedt merged commit 7150693 into zephyrproject-rtos:main Oct 23, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants