Order asset search results by strict priority bands - #8886
Open
Bouh wants to merge 4 commits into
Open
Conversation
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.
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.
4ian
reviewed
Jul 27, 2026
| // 3D assets are preferred over 2D ones. | ||
| const is3DAsset = | ||
| // $FlowFixMe[prop-missing] - only AssetShortHeader has objectType. | ||
| searchItem.objectType === 'Scene3D::Model3DObject'; |
Owner
There was a problem hiding this comment.
@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 :))
Collaborator
Author
There was a problem hiding this comment.
The idea was to separate the search relevance logic into a separate file, which is then passed to UseSearchItem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rank asset store search results in strict, non-overlapping priority bands:
Before/This PR
