I have this fairly typical search/filter page that the user can use to view a specific set of customer objects. I would like to be able to perform "set operations" (union, intersection, difference, etc.) on two different search result sets.

For example, I could have a result set for customers that like red shirts, and one for customers that were born in January. I want to be able to do a do a "set difference" operation, such that I the resulting set would be the customers that like red shirts but were not born in January.

Any thoughts?

  • 3
    Hi Nick, and welcome to UX.SE. As it stands now your question is a poor fit for this site as it doesn't pose a specific UX problem. You're sating you entire problem and then asking for solution suggestions without showing what specific UX problem you are trying to solve.
    – JohnGB
    Commented Jun 10, 2013 at 7:29
  • Hi Nick, I agree with John. The most common approach (that I know of at least) is to use a minus sign before the search parameters you want to exclude in the result. If you've thought of this but discarded it then say why you've done so. And describe which problems you personally see with designing this feature/control and what aspects you'd like help with. Not a mere "help me in this task". Commented Jun 10, 2013 at 8:08
  • Somebody edited my post poorly. I am looking for patterns dealing with "Set Operations" specifically, applied to result sets.
    – surj
    Commented Jun 11, 2013 at 7:28

1 Answer 1


Your question is still not clear. You've stated your needs, you have laid your cards on the table... so what do you need? a solution? a suggestion? or perhaps an opinion?

Assuming its a "way" I make my post & reply.

Set Operation? Think Venn Diagrams

They best represent all possible operations in a way anyone could digest. How? Look at the illustration below:

Using color merge I represent a set of people who like red shirts and were born in January. Similarly you can use color inverse to represent the other scenario.

enter image description here

In a HTML-table or in a Search result panel - I can do a similar color (on rows and columns) based representation to distinguish between results optimal to the selected operation. Check out this example for more ideas and formula.

Cool story so far, How do I construct such a search bar / widget?

If you want to torment your end-users, feel free to use [+] [-] icons and complex filter mechanism in the search text area. OR If you prefer a smooth easy solution try natural language forms as seen here, and here is the code

and here is another illustration:

enter image description here

Replace the fixed AND with OR, or even leave that as an interactive field for the end-user to play with.

  • I love the color merge idea! Your answer is incredibly helpful, thanks a ton!
    – surj
    Commented Jul 31, 2013 at 6:40
  • Tip for your programmers, when you do color merges - use actual mixing and not opacity control for better results. Try this andysoiron.de/demos/color_mixer
    – Rayraegah
    Commented Jul 31, 2013 at 6:46
  • for mixing more than 2 colors, you can get answers here stackoverflow.com/questions/14819058/…
    – Rayraegah
    Commented Jul 31, 2013 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.