enter image description here

I am creating a search box that allows searching for 2 terms, separated by ; but I want to give the user the option to choose between searching only the profiles that have BOTH terms (if "all" is checked), or to search only the profiles that have one of the 2 terms (if "any" is checked). (in other words, you can consider that semi-column to be either an OR, either an AND, between the 2 terms inserted in the search textbox)

In the screenshot you can see the 2 instances of the checkbox at this moment. Someone implied that it's not very intuitive, and the learning curve for a new user is pretty high.

My question: Is there any other best UX practice for such a search box?

  • 1
    @DesignerAnalyst I think this one is more specific to trying to achieve boolean logic with a single text box, but it is very useful to have the link to the other question in the comment.
    – Franchesca
    Commented Jan 5, 2018 at 8:19
  • Related question Intuitive interface for Composing Boolean Logic? Commented Jan 5, 2018 at 8:43
  • I think you ought to put this in an advanced search type option and make the default search anything. This is less confusing for novice users who may not understand boolean logic. You'll also have more room for specific search query options. Commented Jan 5, 2018 at 11:31
  • What is the exact difference between the results of AND and OR. If a result matches both keywords, wouldn't it show up in both situations, or is it an XOR? If that is the case, why implement it at all? Users either won't know the other keyword or will search for it afterwards. Commented Jan 5, 2018 at 15:51

4 Answers 4


I think the learning curve comment you received was more because the switch along with either "All" or "Any" was confusing. When the user is viewing the switch with "All" there is no context as to what exactly it means and what option does one have if the switch was toggled. Apart from this, I don't see any major issue with your current solution.

As all it needs is a bit more context for the user maybe you could change the layout to something like this

enter image description here

This way the user would have a clear picture of what's happening with almost the same amount of effort in searching.

  • Nice solution, but I'd put the "Show results..." below the Search box, as it is secondary and once you understand how it works you will likely ignore it. Commented Apr 9, 2018 at 16:11
  • Yeah, I was a little confused about that part. Decided to put it on top so users could first decide between "And" and "Or" and then type in a query accordingly. Having said that, placing it below makes perfect sense too
    – TDsouza
    Commented Apr 9, 2018 at 17:19

If you are already committed to having a special syntax for typing in the search box, then why bother with the buttons at all?

You could just make the AND and OR functionality part of the syntax for the search string.

If you go this route you need to provide help on screen so users can discover this syntax. Some ideas on displaying this:

  1. A question mark that you can click to show a panel with additional help.
  2. If the syntax is very simple, you can even prefill the search box itself with the syntax hints (in a lighter or italic font).

However be aware that many users will not read such hints, they will just start typing. If a user simply enters search terms seperated by spaces it should therefore return something sensible to get them started.

Example: The basic search returns the AND results by default, and at the top of the results there is a hint that you can click that prefills the search box with the syntax for OR

  • many thanks for your thoughts Franchesca! but I worry that the learning curve for a new user would be much higher in this case.. I am curious about other ideas so let's see :)
    – cabral_007
    Commented Jan 5, 2018 at 8:31
  • @cabral_007 There is no way to increase the amount of functionality available to the users without increasing the learning curve. The trick is to design the interface so that novice users can find and use basic features without incurring the same learning curve that an expert user must encounter to use more powerful and complex features. There are many ways to achieve this; good default settings, feedback / suggestions, help button etc. The stack overflow site is a good example of something that contains hints at syntax for more advanced users (slide out help panels for comment syntax).
    – Franchesca
    Commented Jan 5, 2018 at 15:36
  • I definitely think you should just use AND/OR as it "dogs OR cats", that's how Google handles it. Boolean search terms Google (although I don't see any official evidence the AND does anything different, but OR definitely works)
    – DasBeasto
    Commented Feb 7, 2018 at 21:09

When user search with"OR" use case, how would you represent the search result? What if he search for "A";"B";"C;"....."E". I'm thinking loud but visualisation will be bit clumsy.

Why not make it fuzzy search like google? Let the user search for "tall man" directly and if he really wants some level of filtration, let them do through Advance search.

  • I'm planning to only allow 2 search terms. I think the fuzzy search is a bit hard to implement, because there are terms made of multiple words like ".net framework" for skills..
    – cabral_007
    Commented Jan 5, 2018 at 9:34

I would keep a single text box, a single search button and two triggers (any, all) one below the other.

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.