bug: Filter on Entities page returns inaccurate results
📝 Description & Context
Filter on Entities page returns inaccurate results.
👍 Expected Behavior
Basically, when I filter by substring I expect matches to be always returned that contain this substring. See reproduction steps to understand it better.
🥾 Reproduction steps
I'll give two examples to illustrate how you can reproduce it. I'm sure there are more cases.
The words I used are color-coded with colored bars. White bars mean any set of characters that is none of the words I'm searching by.
Example 1
There's an entity in the list of entities that looks like Red[space]Yellow
Step 1
Search by: Red.
Expectation: all entities containing Red (there are more than one), including Red[space]Yellow.
Result: no matches - inaccurate .
Step 2
Search by: Yellow.
Expectation: Red[space]Yellow - there's only on entity containing Yellow.
Result: no matches - inaccurate .
Step 3
Search by: Red[space]Yellow.
Expectation: Red[space]Yellow.
Result: Red[space]Yellow - accurate .
Example 2
There's an entity in the list of entities that looks like BlueGreen
Step 1
Search by: Blue.
Expectation: all entities containing Blue (there are more than one), including BlueGreen.
Result: an entity that contains neither - possibly accurate if it also searches by description? But the way it works now, looks inaccurate.
Note: usually this search returns what you see in Step 2. I'm not sure what I did to make it return only exactly one match instead of several.
Step 2
Search by: Blue.
Expectation: all entities containing Blue (there are more than one), including BlueGreen.
Result: a list of entities that contains Blue and some that contain neither, but BlueGreen is not there - inaccurate.
Step 3
Search by: Green.
Expectation: all entities containing Green, including BlueGreen.
Result: a list of entities that contains Green, including BlueGreen twice - accurate.
Step 4
Search by: Green.
Expectation: BlueGreen twice.
Result: BlueGreen twice - accurate.
Are you willing to submit PR?
No, I don't have time to work on this right now
This is an issue with the backstage catalog search.. The entity searching is done here https://github.com/drodil/backstage-plugin-qeta/blob/9f40cb811c70824dfc5515dd2f105d3397ba3351/plugins/qeta-backend/src/service/routes/helpers.ts#L429, and for some reason, it does not find the entities based on title correctly.
Is it possible for you to try and send this queryEntities request to the catalog the same way? If you cannot get the results there either, I think the only option is to create issue to backstage core.