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

Is it possible to use search-source with a few collections at once? #23

Open
chompomonim opened this issue May 19, 2015 · 5 comments
Open

Comments

@chompomonim
Copy link

I have to implement global search in my app. It should show search results from Clients, Projects, Orders and Suppliers collections into one list.

Is search-source good choice to do that? If yes, any examples? If not, then also ok, I will just look for some other solutions... ;)

Thanks for any answers.

@arunoda
Copy link
Member

arunoda commented May 19, 2015

Yes. You can search for multiple collections and need to generate a single
array of results.

On Tue, May 19, 2015 at 12:19 PM Jaro notifications@github.com wrote:

I have to implement global search in my app. It should show search results
from Clients, Projects, Orders and Suppliers collections into one list.

Is search-source good choice to do that? If yes, any examples? If not,
then also ok, I will just look for some other solutions... ;)

Thanks for any answers.


Reply to this email directly or view it on GitHub
#23.

@chompomonim
Copy link
Author

@arunoda you mean I should do something like:

GlobalSearch = new SearchSource(['clients', 'projects'], fields, options);

or something like

ClientSearch = new SearchSource('clients', fields, options);
ProjectsSearch = new SearchSource('projects', fields, options);

client_res = ClientSearch.search(some_string);
project_res = ProjectsSearch.search(some_string);

result = client_res.concat(project_res);

And how about relevancy (ordering) of results then? Do you have already some solution or I should create own sorting on client side?

@btbjosh
Copy link

btbjosh commented Sep 4, 2015

+1 I'm really looking for an answer to this question as I need a full app solution for searching multiple collections like this.

@derwaldgeist
Copy link

+1

@krishnaff
Copy link

+1 Searching multiple collections - some guidance would be really great.

Another question: how do we handle multiple keyword search in one collection? For example,
I need to search for
manager sales london contract
through an Applicants collection which has various fields like location, skill, role, type etc.

What I could do right now is make multiple searches for each keyword, but merging the returned array for all keywords and then filtering/sorting is turning cumbersome.
Any ideas/advice please?

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

5 participants