Intersection & within search question

Post Reply
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

Intersection & within search question

Post by jkj2001 »

Just checking here.

If I had a database field to search in, and I was interested in finding the name John Edgar Richardson, but I wasn't sure if there were other terms between the various parts of the name, would this work?

select ID from mytable where AU_NAME like '+John +Edgar +Richardson w/50'

I'm not sure about the three plus signs (never seen it before) and whether it's allowed.

Also, would an intersection "@2" term be appropriate here, or is it overkill in this instance, since I need all three of the terms?

Finally, suppose I knew "John Edgar" would always be together. Is this a good search to try in that case?

select ID from mytable where AU_NAME like '"John Edgar" +Richardson w/50'

Of course, I'm assuming above these terms will be within 50 characters of each other.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Intersection & within search question

Post by mark »

Plus is legal, but redundant in this case. @2 is also redundant. The phrase search would also be good. The + is redundant there too. + is only relevant in a rank search without likepallmatch or when intersections (@) are less than default.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Intersection & within search question

Post by Kai »

The plus sign means the term is required to be present. The @ operator only applies to unadorned or `=' sets, not `+' or `-' (negated) sets. So you don't need @ if giving the plus signs.

Yes, making "John Edgar" a phrase to ensure the words are adjacent, if you know that, is a good idea, to narrow down the search. You could put a plus sign too (eg. +"John Edgar") though since @0 is the default and there's only one unadorned set in your example, it won't matter in this case.
Post Reply