Searching using a compound index possible?
Hi there. Thanks for this really great wrapper for indexeddb but I'm missing something and hope it could be possible in some way?
I couldn't find something in your blog post or the documentation of the git project.
The solution I'm searching for should work like explained here where you are able to deal with multiple indexes.
Regards.
Nope at the moment there isn’t but I think it shouldn’t be too difficult to add, make index take a rest argument, feel free to drop me a PR, otherwise I’ll get to it when I have some time.
Hi Aaron, thanks for your fast response.
I got something that looks like a solution for now using the filter-functionality more than ones like this:
server.people.query().filter( 'firstName' , 'Aaron' ).filter( 'answer' , 43 )....
This seem to work since there are 2 people of firstName = 'Aaron' but only one with answer = 43 and it is done with only one result.
On the other hand this isn't really searching the indexeddb, instead searching the resultset of the database so it might be slower if running on a huge amount of data, isn't it?
PS: Hope you will have some time to get into it really soon ;-)
Regards.
Yeah I figured that’d be the way you’d go about it, alternatively you could use an index for one of the query terms, ideally the one that would reduce the result set the most
Hi Aaron,
thx. I will give it a try with indexing one of the query terms for my huge amount of data and play around with it.
Regards.
I'll leave this open, I'm less likely to forget about it otherwise
Hi I don't understand, if the solution already exists to search with two filters, or are planning to do this. I would love to know how I filter something with two parameters
Regards
You can already use multiple filters (only the first goes into an index query), I’d like to get compound index queries supported by I haven’t had time
This looks like a dupe of #40.
Compound queries are now demoed in the README and in the indexes test. So this issue can be closed.