Skip to content

feat(search): freetext and name queries include metadata fields#2988

Open
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:fix/search-freetext-metadata
Open

feat(search): freetext and name queries include metadata fields#2988
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:fix/search-freetext-metadata

Conversation

@flash7777

Copy link
Copy Markdown

Summary

Companion to #2987 (metadata indexing). Extends the Bleve query compiler so that freetext and name queries also search indexed metadata fields.

Changes

File Change
compiler.go Freetext queries use _all field (includes Metadata) instead of only Name
compiler.go Name queries expanded to disjunction: Name:*term* OR _all:term
compiler_test.go Updated expected queries for freetext

Motivation

The Web UI sends name:"*term*" KQL queries. Without this change, searching for a metadata value like 11.12.01 (a file reference) returns no results even though the metadata is indexed. With this change, both freetext and name queries search the _all field which includes all dynamic metadata.

Test plan

  • Freetext search for a metadata value returns matching resources
  • Name search (name:"*11.12*") returns resources with matching metadata
  • Normal name search still works as before
  • Existing unit tests updated and passing

Freetext queries (no field prefix) now search the _all field instead
of only Name. This includes dynamic Metadata fields indexed by opencloud-eu#2987,
making custom metadata like file references discoverable.

Name queries (sent by Web UI as name:"*term*") are expanded to
a disjunction: Name:*term* OR _all:term — so searching for metadata
values like "11.12.01" returns matching resources.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant