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

Multiple filters #65

Open
maliyshock opened this issue Mar 19, 2019 · 7 comments
Open

Multiple filters #65

maliyshock opened this issue Mar 19, 2019 · 7 comments

Comments

@maliyshock
Copy link

Hey, guys. I need to release search form with: category drop-list, text input named "name" and another one named "profession". All of them should work at the same time and specify the content.

For example imagine a catalog of people with different professions, names, and categories.
If type "Jhon" in the field "Name" it is going to rid off all over, but it keeps all "John's" with different professions and categories. If I type "engineer" in profession field, it is going to leave all "Jhon's" with engineer profession.

Does your plugin provide such kind of functionality?
Can I work with droplists?
Do you have API?

@maliyshock
Copy link
Author

I re-reaad the documentation. I think it could be possible by adding custom fields.
But there are no instructions how can I do that? I see the pieces of code in tntsearch.php but I still do not understand what should i do to add one more field

@rhukster
Copy link
Member

rhukster commented Mar 23, 2019

It’s certainly possible to index different fields but the problem is tntsearch (the actual library we use) has no way to filter or specify fields during query. This is something that they say they will add but it’s not there yet. All you can do is get results back then load the objects for each item and further filter manually in php. Far from ideal.

@maliyshock
Copy link
Author

Yes. What I found is GravTNTSearch.php file, where onTNTSearchQuery event is firing. So I guess I need to make fixes here or maybe make them right before render, as you said when I got result from tnt search. Need to think about it.

Thanks.

@maliyshock
Copy link
Author

Ok. I digged deeply to the core of TNT search. I guess there is no reason to do something with that, because all aechitecture of search engine is specified of 1 word or phrase search.

My case is more like this one https://github.com/ash0080/grav-plugin-cascade-filters

@rhukster there is big API right here https://learn.getgrav.org/15/api
May I ask you to give me a hint, where I can find info how to get all Gav pages with specific taxonomies?

@rhukster
Copy link
Member

My suggestion is to look at the taxonomy plugin. It does just that.

@maliyshock
Copy link
Author

Ok. May I ask you to share the link? or did you meant this one?
https://github.com/getgrav/grav-plugin-taxonomylist

I belive this one should work too https://github.com/ash0080/grav-plugin-cascade-filters

@rhukster
Copy link
Member

First one was the one I was referring to. Not familiar with second.

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

2 participants