Advanced logic is online!

0 views
Skip to first unread message

Piffany

unread,
Jun 2, 2007, 4:01:38 PM6/2/07
to Piffany
The advanced logic module for the back end is now installed. This
allows you to search for not only multiple words, but multiple words
with logical operators like AND, OR, and NOT, as well as exact phrases
using quotes. I don't expect kids to use these operators regularly but
I think educators and parents may find them useful. Google has an
advanced search page that makes these kind of commands easier to use
(http://www.google.com/advanced_search?hl=en). Perhaps we can
implement something similar. Regardless of the final implementation,
it is an important functionality to have implemented on any search
engine.

Let me give you a quick tutorial on how to use the advanced logic. All
operators are entered in uppercase text to distinguish them from
search tokens, e.g., AND, OR, NOT. Let's designate search tokens
(words) as A, B, C, etc., and consider the following:

***AND (default operator)***
I want documents containing all the words A, B, and C.

A AND B AND C

Since AND is the default operator for Piffany, you could simply type

A B C

***OR***
I want documents with at least one of the words A, B, or C.

A OR B OR C

***NOT***
I want documents with all the words A but that do not contain the
word C.

A NOT C

***Exact phrases***
I want documents that contain the phrase "A B C".

"A B C"

Operators are not allowed within the quotations, and if present, they
will be treated as search tokens instead.

Any combination of these operators will work. For example, try
searching for

Mark Twain OR "Huckleberry Finn" NOT Shania

***Finally, a word on RPN logic***
Since the operators are based on RPN (reverse polish notation) logic,
certain operations are not allowed. RPN logic requires that two only
two sets are allowed in the stack and can be operated on only with a
single operator. For example, 2, 2, + results in the number 4. Using
RPN, you can not perform the following: A AND B AND (C OR D). To
enable logic that accounts for order of operations would require
storing stack contents in memory for retrieval later. This is
computationally too expensive and would probably only be used by a
limited number of users. For more on RPN, see
http://en.wikipedia.org/wiki/Reverse_Polish_notation

Message has been deleted

Piffany

unread,
Jun 5, 2007, 12:11:42 PM6/5/07
to Piffany
I think I fixed the bug, but the scary thing is I don't know how.
Since the bug was not present in my administrative portal, I copied it
to the public search algorithm. Now, if you type Harry NOT Potter you
get sites about Harry Truman. Also "Mark Twain" NOT Shania works
again. When I have some free time (right) I will go back and see if I
can discover where the problem was.

David

Reply all
Reply to author
Forward
0 new messages