You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
The useful searchable fields are brand and model. Barcode and category are not currently displayed in the inventory list, so it would be confusing if the search bar showed results for those two pieces of data.
There are two ways I could implement this.
First, MySQL supports full-text search (though Knex.js only supports it via .raw functions). This approach wouldn't work in this specific instance, however, because the item table does not have any textual fields to search (other than barcode, which the average user would not be searching for). I could make a view containing all the textual data related to items, but it is impossible to create fulltext indexes on views.
It might be possible to change the name columns in brand and model to full-text indexes, then to use the match againstsyntax to search them in query where they are joined with the item table. This is worth looking into. Tutorial on full-text searches in MySQL.
The implementation of this feature shows the value of #373 (Refactor endpoint service) because it involves adding yet another optional parameter to endpoint.getAll that is passed through to the db service.
In this case, there is some logic implemented in the endpoint service before the parameter is passed to the db service, but that could also be implemented with a simple service method called by the endpoint itself before passing the search to the db service.
As a user,
I want to be able to find an item by searching for its brand or model
so that I can find it more easily.
The text was updated successfully, but these errors were encountered: