Discussion on union/intersection of search filters

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
KayJay
Propeller Head
Posts: 23
Joined: Tue Nov 29, 2016 7:19 am

Discussion on union/intersection of search filters

Post by KayJay »

Hi all,

It seems that some of us have come up against the problem of wanting to combine multiple search filters at once (see viewtopic.php?f=9&t=29645&p=129418 and https://www.madcapsoftware.com/blog/201 ... e-outputs/) in client-based HTML5 search. I can see many applications of this: if filtering for roles, a user may want to search across multiple roles that they have at once (a union of search filters). Alternatively, if we could make use of the intersection of filters, they may want to search across the intersection of the product version they use and the role they have.
For me, this functionality would save the effort of having to create filters with all the possible combinations of roles, rather than just one filter for each role.

It seems like MadCap isn't planning any action on this, but it is pretty easy thing to program - yesterday I made a prototype that allows you to search the union of two search filters by changing MadCapSearch.js after building.
So far my prototype just reads multiple comma-separated filter names from the URL parameters and includes the results that match any of the filters.
E.g.

Code: Select all

SearchResults.htm?q=term&f=filter1,filter2
My question is - how would you present/use this feature? Has anyone developed a form like this wireframe viewtopic.php?f=9&t=29645&p=129418 that could refresh the search page with the same query and selected filters as the ?f= URL param? Is anyone applying a search filter that they infer from elsewhere (e.g. a cookie? local storage?)?

Looking forward to starting a discussion about this.
Happy to share the added lines to the code in MadCapSearch.js if there's interest on working on this (not sure if it would be a copyright violation to post the whole file?).

-Kristy

PS: It could be that realistically this functionality is useless without boolean search syntax for filters (e.g. (filter1 OR filter2) AND filter3). (Note: This would be pretty easy for madcap to develop as they have existing code to parse this syntax in MadCapParser.js for the search query, but it's beyond my JS abilities to do this.) Interested to hear if you think that's the case.
wowbagger
Jr. Propeller Head
Posts: 2
Joined: Tue Jul 17, 2018 1:52 pm

Re: Discussion on union/intersection of search filters

Post by wowbagger »

I'm very interested in how you altered MadCapSearch.js to do this. We're looking to implement something similar, with cookies to remember which filter(s) a user chose. I couldn't see a way to contact you on your profile, but if you don't mind sharing your solution, my email address is a gmail.com address with the username didine.

-Leif
Post Reply