Some applications need to offer advanced search beyond this existing full text index. This often includes joining on additional tables other than the text index table to restrict the search results based
on additional criteria. For example, one might wish to search by the author or creation user of an object, the title or pretty name of that object, restrict search to a particular object type, package instance, or subsite.
I propose to add the ability to define operators that trigger search on additional database columns or tables. See http://www.google.com/help/operators.html for examples of the type of operators used at google.com.
Each operater would be defined by a service contract (or Tcl Callback see https://openacs.org/forums/message-view?message_id=273782 )
The tcl procedure that implements an operator would accept a Tcl list argument that contained all the query "words" that are associated with that operator. It would return a two element list. The first element would be the name of a table to join against. The second element would be a where clause to add to the query.
If no opertaor is found the elements of the search query after the operator would be appended to the default full text search query.
I have already implented a variation on this system for the Greenpeace CTK project and I need something similar for a current project so I will be working on this. I would like to find a solution that can be added back into OpenACS that can eventually support PostgreSQL and Oracle, and be independent of the full text indexing solution that is used. It might be the case that each full text indexing driver would need to take the query fragments and put them into the full query for the search results. Most of the work should be done by procedures in the Search package that can be accessed from any full text indexing implementation.