[turba] imp name expansion - turba sql problem

liamr@umich.edu liamr@umich.edu
Mon, 19 Aug 2002 18:14:01 -0400


I've been thinking about this a bit..  I guess it comes down to the question of 
what are "strict" searches for?  

Are strict searches...
- searches where the data being searched for must be present in the search
  results along with whatever data you're searching for?

ie
    select ... from turba_objects where 
    (object_alias = 'alias' AND owner_id = 'liamr') 
    AND (object_name like '%alias%')

- to be used when you want an exact match in one of the fields your searching?
  (as opposed to an ldap query for *blah*, or a sql query for %blah%).

ie
    select ... from turba_objects where 
    (owner_id = 'liamr')
    AND ((object_alias = 'alias')
    OR (object_name like '%alias%'))

Say we were only searching turba's sql tablespace for one "strict" field, and 
nothing else...  currently, the query would be:

    select ... from turba_objects where 
    (object_alias = 'alias' AND owner_id = 'liamr')

I think I can better illustrate what I think the groupings should be if I play 
with the parentheses:

    select ... from turba_objects where 
    (owner_id = 'liamr') AND (object_alias = 'alias')

because as soon as you start adding on other fields into the search, they 
should be added to the query after that initial AND.

Does this make sense?  Or do I not understand the purpose of "strict" fields?

Liam