Page 1 of 1

Intersection & within search question

Posted: Fri May 06, 2005 4:31 pm
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.

Intersection & within search question

Posted: Fri May 06, 2005 4:47 pm
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.

Intersection & within search question

Posted: Fri May 06, 2005 4:48 pm
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.