If you already have the keywords
in a list and you need to query the database to check what category
is that value, then I would suggest you to index
your database on the keyword field
and that way you'll have the best performance.
objectStore.createIndex('keyword');
If you use the category
index you'll need to iterate through all items with a cursor and that's slower since multiple objects belong to same category.
Also if your keywords list can contain both cars
and fruits
then you need to keep all objects in the same table, otherwise you can split the data into more tables for faster performance.