Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching using a compound index possible? #46

Open
RonMen opened this issue Nov 11, 2013 · 9 comments
Open

Searching using a compound index possible? #46

RonMen opened this issue Nov 11, 2013 · 9 comments

Comments

@RonMen
Copy link

RonMen commented Nov 11, 2013

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.

@aaronpowell
Copy link
Owner

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.

@RonMen
Copy link
Author

RonMen commented Nov 11, 2013

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.

@aaronpowell
Copy link
Owner

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

@RonMen
Copy link
Author

RonMen commented Nov 11, 2013

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.

@RonMen RonMen closed this as completed Nov 11, 2013
@aaronpowell aaronpowell reopened this Nov 11, 2013
@aaronpowell
Copy link
Owner

I'll leave this open, I'm less likely to forget about it otherwise

@jdaison
Copy link

jdaison commented Dec 3, 2013

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

@aaronpowell
Copy link
Owner

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

@brettz9
Copy link
Contributor

brettz9 commented Mar 27, 2016

This looks like a dupe of #40.

@brettz9
Copy link
Contributor

brettz9 commented Apr 11, 2016

Compound queries are now demoed in the README and in the indexes test. So this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants