FriendsOfFlarum / user-directory

The permission based public user directory extension for your Flarum forum.
https://discuss.flarum.org/d/5682
MIT License
22 stars 20 forks source link

More complex filter and search in the user directory #73

Open vvovkata opened 3 years ago

vvovkata commented 3 years ago

The user directory has huge potential but currently, it can search users based on their groups and user name.

Would be great if we can have a search based on each field we create.

For example, if we create 4 fields: 1 of them is "Location", 2nd is "Education" and 3rd is "Skills", 4th is years of experience. Then we can search for all users that are at a specific location, with specific education and specific skills, with specific years of experience. All 4 together, while 1 won't exclude the other but the filter preferences should be additive.

Also, the dropdown should allow multiple choices.

clarkwinkelmann commented 3 years ago

How would those fields be added? I don't think there's any change that has to be done in this extension, every third-party extension is already able to add filters by themselves.

The Masquerade extension adds a search gambit for answers, I think it's called answer: and can be used in the search field.

My own Formulaire extension doesn't have any search integration but this might come in the future.

The Taxonomies extension had an integration with User Directory in beta 13 but it's broken in Flarum 1.0 because we completely changed how filters are implemented in User Directory. This will likely be added back one way or another once I finish the 1.0 update of Taxonomies.

If you make a custom extension to add those fields, then your custom extension can add the filters on the User Directory page as needed.

vvovkata commented 3 years ago

Yes, sorry, forgot to mention that I am using the Masquerade extension so my suggestion wasn't very clear. I was wondering if both extensions can sync in some way so we have searchable fields in the user directory page.

clarkwinkelmann commented 3 years ago

Another issue with Masquerade is that if the field is free text, a dropdown with all options wouldn't be very user friendly. It would make more sense for those fields to integrate with the full text search.