Bug: Comma vs. OR in search syntax

Page 2 of 3 (60 items) < Previous 1 2 3 Next >
This post has 59 Replies | 2 Followers

Posts 1341
PL | Forum Activity | Replied: Wed, May 19 2010 1:10 PM | Locked

But Robert had a vertical bar | (which means the same as OR) in example #5, so it's not malformed.

Posts 349
Frank Fenby | Forum Activity | Replied: Wed, May 19 2010 1:40 PM | Locked

PeterLi:
But Robert had a vertical bar | (which means the same as OR) in example #5, so it's not malformed.

I took that to be his cursor. It appears in different places in his examples.

The wiki article http://wiki.logos.com/Search_HELP does not list the vertical bar as an operator. I wish it were an operator, it matches the standard that I have used for years.

Posts 4508
Robert Pavich | Forum Activity | Replied: Wed, May 19 2010 1:48 PM | Locked

Though WFF 'n proof came out in 1961, the company is still around and making games...and W 'n P is still available!

 

http://wffnproof.com/

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Posts 24935
Forum MVP
Dave Hooton | Forum Activity | Replied: Wed, May 19 2010 9:19 PM | Locked

Frank Fenby:
Based on what Bradley said above, comma and OR are not the same. I wonder what the difference is. He did indicate it had to do with precedence, which might explain why nesting the operations gave different results.

Here's some empirical results and guidelines.

1. Get Zero results when you know better

lord NEAR (Jesus AND Christ)   -  gives 0 results --> avoid mixing boolean and non-boolean operators [NEAR]

lord AND (Jesus AND Christ)   -  OK

lord AND (Jesus  Christ)   -   treats AND as a word  -->  avoid mixing boolean and non-boolean operators [the space for AND]

Alternatives:  lord Jesus Christ;  "lord Jesus Christ"; lord NEAR Jesus NEAR Christ  -->  Keep it simple

 

2. Results may look OK

lord NEAR (spirit OR God)   - treats NEAR as a word  --> avoid mixing boolean and non-boolean operators

lord NEAR (spirit AND god)  - treats NEAR as a word  --> avoid mixing boolean and non-boolean operators

(lord Jesus) OR Christ - treats OR as a word  --> avoid mixing boolean and non-boolean operators [the space for AND]

 

3. Exceptions (where mixing works)

(lord NEAR Jesus) OR (lord NEAR Christ)  is equivalent to lord NEAR (Jesus, Christ) but results are different because of the way "lord" is counted!

 

4. Precedence

parentheses (..)  override operator precedence  e.g. lord AND (spirit OR God)  is not lord AND spirit OR God = (lord AND spirit) OR God

logical AND + Proximity operators >> logical OR  e.g. lord BEFORE Jesus OR god NEAR Christ  = (lord BEFORE Jesus) OR (god NEAR Christ)

 

5. Guidelines

Avoid mixing boolean and non-boolean operators [NEAR, BEFORE, space, comma etc.].

Use Lists [comma separated terms instead of OR] with non-boolean operators.

Avoid using space for AND in mixed expressions

 

Dave
===

Windows & Android

Posts 24935
Forum MVP
Dave Hooton | Forum Activity | Replied: Wed, May 19 2010 9:37 PM | Locked

Frank Fenby:
The wiki article http://wiki.logos.com/Search_HELP does not list the vertical bar as an operator.

Take your pick of symbols that work as AND in simple cases:-

| + & > <

eg. lord | Jesus; lord + Jesus 

NB. lord|Jesus|christ = "lord jesus christ"

For obvious reasons these will not be documented in the wiki.

Dave
===

Windows & Android

Posts 4508
Robert Pavich | Forum Activity | Replied: Thu, May 20 2010 3:30 AM | Locked

Dave Hooton:

lord NEAR (Jesus AND Christ)   -  gives 0 results --> avoid mixing boolean and non-boolean operators [NEAR]

 

Dave Hooton:

Avoid mixing boolean and non-boolean operators [NEAR, BEFORE, space, comma etc.].

Dave,

I know that this is going to make me sound stupid but I'll ask...could you please explain more fully? Why do you not mix "AND" "OR" "NEAR" or "BEFORE"?

I'm not following...

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Posts 13360
Forum MVP
Mark Barnes | Forum Activity | Replied: Thu, May 20 2010 4:06 AM | Locked

A search for lord NEAR (Jesus AND Christ) is illogical syntax. If you think about it, Jesus AND Christ means that the words Jesus and Christ both appear in the same article. There's what position is the results of that search? The position of Jesus? The position of Christ? The middle of the two? You can't really then do a proximity search with the results of that.

What you probably really mean is one of the following:

  1. (lord NEAR Jesus) AND (lord NEAR Christ)
  2. (lord NEAR Jesus) AND (lord NEAR Christ) AND (Jesus NEAR Christ)

(Those are three different queries, that - in theory - provide three different search results. You'd need to run the search on your entire library to see the difference. Look at the article count when you do so. I get article counts of 41,826 and 40,624 in my library.)

Imagine the following articles (… represents a long gap):

  • "Lord Jesus Christ" - this would match both.
  • "Lord Jesus … the Lord the Christ" - this would match (1), but not (2) because Lord is not near to Christ.

 

Posts 13360
Forum MVP
Mark Barnes | Forum Activity | Replied: Thu, May 20 2010 4:21 AM | Locked

I should add that I disagree with Dave slightly. The rule is not "Avoid mixing boolean and non-boolean operators". The rule is that you shouldn't use do a proximity search with a result that doesn't return a position. So

  • (Lord OR Jesus) NEAR Christ doesn't work, because Logos does this logically. It first does (Lord OR Jesus), but as this search doesn't return position information, it can't carry on.
  • (Lord, Jesus) NEAR Christ does work, because Logos internally translates this into (lord NEAR Christ) OR (Jesus NEAR Christ)

So this is not a bug as such. It's just that what is logical in our minds isn't necessarily logical mathematically.

Posts 4508
Robert Pavich | Forum Activity | Replied: Thu, May 20 2010 4:44 AM | Locked

Mark,

thank you for the thorough explanation...I'll ruminate on that for a while. :)

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Posts 4508
Robert Pavich | Forum Activity | Replied: Thu, May 20 2010 5:37 AM | Locked

So..Mark,

It's the positional thing that messes things up.

Then these would be valid searches:

(Jesus BEFORE Christ) NEAR whom

OR

(Jesus BEFORE Christ) WITHIN 10 words whom

 

right?

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Posts 24935
Forum MVP
Dave Hooton | Forum Activity | Replied: Thu, May 20 2010 5:40 AM | Locked

Mark Barnes:
The rule is not "Avoid mixing boolean and non-boolean operators". The rule is that you shouldn't use do a proximity search with a result that doesn't return a position.

Mark, your feedback is welcome as I wasn't entirely satisfied with the "Avoid..." guideline. I'm wanting something that is relatively self-explanatory for the wiki.

Dave
===

Windows & Android

Posts 4508
Robert Pavich | Forum Activity | Replied: Thu, May 20 2010 5:44 AM | Locked

Clearly, I'm going to purchase the WFF 'n Proof game soon.... Embarrassed

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Posts 13360
Forum MVP
Mark Barnes | Forum Activity | Replied: Thu, May 20 2010 6:04 AM | Locked

Robert Pavich:

Then these would be valid searches:

(Jesus BEFORE Christ) NEAR whom

OR

(Jesus BEFORE Christ) WITHIN 10 words whom

Yes! Doing the search (Jesus BEFORE Christ) WITHIN 1 WORDS whom in the ESV really clearly shows how that syntax is interpreted.

Posts 13360
Forum MVP
Mark Barnes | Forum Activity | Replied: Thu, May 20 2010 6:06 AM | Locked

Dave Hooton:
Mark, your feedback is welcome as I wasn't entirely satisfied with the "Avoid..." guideline. I'm wanting something that is relatively self-explanatory for the wiki.

Somewhere there's a post from Bradley a couple of months ago that talks (I thought) about OR searches returning a binary result which is why the can't be used in this context. But I can't find the post. I'm pretty sure you were part of the discussion though. Do you remember?

Posts 4508
Robert Pavich | Forum Activity | Replied: Thu, May 20 2010 6:09 AM | Locked

Mark,

Hey! You're right...it really illustrates that idea well...thanks very much.

 

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Posts 24935
Forum MVP
Dave Hooton | Forum Activity | Replied: Thu, May 20 2010 6:33 AM | Locked

Robert Pavich:

Then these would be valid searches:

(Jesus BEFORE Christ) NEAR whom

OR

(Jesus BEFORE Christ) WITHIN 10 words whom

Now we are getting deep. They work but I can demonstrate a problem with (Christ BEFORE Jesus) NEAR whom:-

ESV:  7  in 3 verses. Expected 9 in 3   (similar in NASB95)

If proximity was an issue only Acts 2:36 should be returned. Why return two results in each of the other 2 verses?

(Christ BEFORE Jesus) WITHIN 9 words whom returns the same results so we know that NEAR is 9 words! To obtain the expected result I have to use (Christ BEFORE Jesus) WITHIN 13 words whom but still get anomalous results with other separations. I'll register this as a bug.

Dave
===

Windows & Android

Posts 13360
Forum MVP
Mark Barnes | Forum Activity | Replied: Thu, May 20 2010 6:49 AM | Locked

Dave,

As I said to Robert the search (Jesus BEFORE Christ) WITHIN 1 WORDS whom shows exactly how these strings are interpreted. It's hard to put into words, but it's something like this: Search for verses where Jesus appears before Christ and one of those words is NEAR to 'whom'

If you run the search and you'll 'see' it.

So (Jesus NEAR whom) BEFORE Christ searches for occasions where Jesus is near to whom, and one of those words is BEFORE Christ.

If you want a search string that only returns Acts 2:36 you would be searching for occasions where Jesus is near to whom and both of those words are BEFORE Christ. I don't think that's possible.

I'm not sure that's a bug, or even unexpected behaviour, but it does illustrate the complexity of linking searches with a proximity operator, and of the inadequacy of Logos' documentation.

Posts 24935
Forum MVP
Dave Hooton | Forum Activity | Replied: Thu, May 20 2010 6:53 AM | Locked

Mark Barnes:
Somewhere there's a post from Bradley a couple of months ago that talks (I thought) about OR searches returning a binary result which is why the can't be used in this context. But I can't find the post. I'm pretty sure you were part of the discussion though. Do you remember?

Yes! But I struggled to express that "simply". I'll have another go tomorrow.

Dave
===

Windows & Android

Posts 24935
Forum MVP
Dave Hooton | Forum Activity | Replied: Thu, May 20 2010 7:14 AM | Locked

Mark Barnes:

If you run the search and you'll 'see' it.

So (Jesus NEAR whom) BEFORE Christ searches for occasions where Jesus is near to whom, and one of those words is BEFORE Christ.

Obviously, I ran Robert's search (Jesus BEFORE Christ) NEAR whom. It illustrates both words satisfying the NEAR constraint. (Christ BEFORE Jesus) NEAR whom did not. 

Dave
===

Windows & Android

Posts 4508
Robert Pavich | Forum Activity | Replied: Thu, May 20 2010 7:20 AM | Locked

Mark ANDEQUALS verysmart

Dave ANDEQUALS verysmart

Robert ANDEQUALS thankful.

Wink

Robert Pavich

For help go to the Wiki: http://wiki.logos.com/Table_of_Contents__

Page 2 of 3 (60 items) < Previous 1 2 3 Next > | RSS