User AND OR search

Y

yannii

I'm writing some software and one of the things I'd like to be able to add
in is the facility to search for orders that contain certain products. Now,
I want to give the user the choice of building reasonably complicated
queries, using combinations of products, say

eg1: product1 AND product2
eg2: product2 OR product2 OR product3
eg2: (product1 AND product2) OR (product3 AND product4)

Now while all this is trivial stuff to programmers or SQL writers, I'm
having difficulty in thinking of an easy way to present this to a user.

I was wondering if anyone had any experience of writing a simple front end
for such expressions, simple enough that non-techies could use it. Or if
anyone could point me to other software that has similar features.
 
F

Frank Birbacher

Hi!
eg1: product1 AND product2
eg2: product2 OR product2 OR product3
eg2: (product1 AND product2) OR (product3 AND product4)

Now while all this is trivial stuff to programmers or SQL writers, I'm
having difficulty in thinking of an easy way to present this to a user.

Why not let the user enter such expressions like the above? AFAIK common
search engines like google allow this, too (to some extend).

Frank
 
C

Chris Smith

yannii said:
I'm writing some software and one of the things I'd like to be able to add
in is the facility to search for orders that contain certain products. Now,
I want to give the user the choice of building reasonably complicated
queries, using combinations of products, say

eg1: product1 AND product2
eg2: product2 OR product2 OR product3
eg2: (product1 AND product2) OR (product3 AND product4)

Now while all this is trivial stuff to programmers or SQL writers, I'm
having difficulty in thinking of an easy way to present this to a user.

Here are my random thoughts... not that I've ever done something like
this, much less tried to support the results.

One very effective way to make something more understandable to a user
is to cut down the number of options until they can experiment and cover
all the bases through experimentation. Toward that end, I'd propose you
recognize that it's always possible to formulate any boolean expression
composed of and/or/not by using a three level form, where the top level
is:

A or B or C or ...

and each element of that is composed of:

A1 and A2 and A3 and ...
B1 and B2 and B2 and ...

and each element of that is either "A1'" or "not A1'". Actually
formulating an arbitrarily deep expression in those terms is a rather
mathematically involved process, of course, but perhaps if you provide
that form as the only option, your users will solve there problem in
those terms, making it easier on them.

Once you've mandated this form, I can see a two-stage process, by which
you first present them with a form whereby they list conditions, making
it clear that matching any of those conditions is sufficient (that is,
it's an OR operation). When they choose to add a condition, you could
display a second "condition definition" sort of dialog, which would
display all the products and let them drag each product into a "must
have" or a "must not have" column. When finished, they click okay
there, and the new condition appears in the condition list.

Does that make sense? I could try to draw some ASCII art if it would
help.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
M

Michael Borgwardt

yannii said:
eg1: product1 AND product2
eg2: product2 OR product2 OR product3
eg2: (product1 AND product2) OR (product3 AND product4)

Now while all this is trivial stuff to programmers or SQL writers, I'm
having difficulty in thinking of an easy way to present this to a user.

I was wondering if anyone had any experience of writing a simple front end
for such expressions, simple enough that non-techies could use it.

Impossible, I'd say. The very *concept* of nested boolean expressions is too
complex for most people, and no user interface can do anything about that.
 
E

ExGuardianReader

Michael said:
Impossible, I'd say. The very *concept* of nested boolean expressions is
too
complex for most people, and no user interface can do anything about that.

I disagree.

I've just written a report generator that generates SQL from a user
interface which allows complex conditions.

My user interface was DHTML/javascript with the back end running on JSPs
and EJBs. I based the condition user interface on that used in
http://www.korzh.com/delphi/sq/

(Except that mine works better, and doesn't get confused when you add
and delete lines! - it renumbers the whole set correctly every time a
line is modified and generates working SQL etc .... trumpet, trumpet!!)

Nige
 
D

David Segall

ExGuardianReader said:
I disagree.

I've just written a report generator that generates SQL from a user
interface which allows complex conditions.

My user interface was DHTML/javascript with the back end running on JSPs
and EJBs. I based the condition user interface on that used in
http://www.korzh.com/delphi/sq/

How do your users express the OP's third example? It's not obvious
from the web site. I was going to suggest the Find Results section of
Google's Advanced Search (http://www.google.com.au/advanced_search)
because it is simple and many users are familiar with it but it won't
accept that example.
 
M

Michael Borgwardt

ExGuardianReader said:
I disagree.

I've just written a report generator that generates SQL from a user
interface which allows complex conditions.

My user interface was DHTML/javascript with the back end running on JSPs
and EJBs. I based the condition user interface on that used in
http://www.korzh.com/delphi/sq/

I'm unimpressed. Judging from the demo on that site, the main advantage
is that it hides the complexity of the inner workings of the DB (joins and
such). But I'm quite sure that it can do nothing whatsoever to make boolean
conditions more complex than a simple AND or OR understandable to
non-tech-savy people.
 
F

Frank Birbacher

Hi!
Now while all this is trivial stuff to programmers or SQL writers, I'm
having difficulty in thinking of an easy way to present this to a user.

Maybe you could go this way: Have the user enter an easy expression
(only AND or OR). When presenting the results, ask whether to filter the
result set again. This way the user can decrease the result set in many
different ways. And the user directly sees whether he/she still needs to
do apply further filters, or whether he/she is already done.

Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top