Skip to content

Order asset search results by strict priority bands - #8886

Open
Bouh wants to merge 4 commits into
masterfrom
searching-results
Open

Order asset search results by strict priority bands#8886
Bouh wants to merge 4 commits into
masterfrom
searching-results

Conversation

@Bouh

@Bouh Bouh commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Rank asset store search results in strict, non-overlapping priority bands:

  1. 3D assets with an exact word match (whole word in the name, or an exact tag)
  2. 2D assets with an exact word match
  3. Everything else (partial name match or a single full tag), ordered by score with a malus when the item has too many tags.

Before/This PR
image

image image image

Rank search results so that whole-word matches beat partial matches, a
match in the item's name or an exact tag match is boosted above matches
found only among the other tags, and 3D assets are slightly favored at
comparable relevance. Remaining items keep their computed scores.
@Bouh
Bouh requested a review from 4ian as a code owner July 24, 2026 19:16
Rank results with non-overlapping bands so the priority is strict:
3D assets with an exact word match, then 2D assets with an exact word
match, then everything else (partial name match or single full tag)
ordered by score with a malus when the item has too many tags.

Document each score weight as a named, commented constant.
@Bouh Bouh changed the title Prioritize asset name and tag matches in search results Order asset search results by strict priority bands Jul 24, 2026
// 3D assets are preferred over 2D ones.
const is3DAsset =
// $FlowFixMe[prop-missing] - only AssetShortHeader has objectType.
searchItem.objectType === 'Scene3D::Model3DObject';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@Bouh This notion of 2D, 3D assets, should not be the responsibility of UseSearchItem.

UseSearchItem is a generic function/component and should rather be taking whatever it needs as a prop/function/callback/parameter so that the caller can set how the "bands" work. But it's the caller responsibility (because the caller is aware of what is being searched), not the UseSearchItem (which is a generic system to search ANY item).

(tell this to the AI to see what it does :))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The idea was to separate the search relevance logic into a separate file, which is then passed to UseSearchItem.

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.

2 participants