search-procs.tcl

full-text search engine

Location:
packages/search/tcl/search-procs.tcl
Author:
Neophytos Demetriou <k2pts@yahoo.com>
CVS Identification:
$Id: search-procs.tcl,v 1.55.2.10 2023/03/09 13:39:17 antoniop Exp $

Procedures in this file

Detailed information

callback::search::action::contract (private)

 callback::search::action::contract [ -action action ] \
    [ -object_id object_id ] [ -datasource datasource ] \
    [ -object_type object_type ]

Do something with a search datasource called by the indexer after having created the datasource.

Switches:
-action
(optional)
UPDATE INSERT DELETE
-object_id
(optional)
-datasource
(optional)
name of the datasource array
-object_type
(optional)
Returns:
ignored
Author:
Jeff Davis <davis@xarg.net>

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::datasource::contract (private)

 callback::search::datasource::contract -object_id object_id

This callback is invoked by the search indexer when and object is indexed for search. The datasource implementation name should be the object_type for the object.

Switches:
-object_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::driver_info::contract (private)

 callback::search::driver_info::contract

This callback returns information about the search engine implementation

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::extra_arg::contract (private)

 callback::search::extra_arg::contract [ -value value ] \
    [ -object_table_alias object_table_alias ]

Generate a query fragment for search filtering by extra argument. Argument name will be the implementation name called. Search driver should call this for every extra argument and then build the search query using the query fragments returned.

Switches:
-value
(optional)
value of the argument
-object_table_alias
(optional)
SQL alias of table that contains the object_id to join against
Returns:
list in array format of {from_clause {} where_clause {}}

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::index::contract (private)

 callback::search::index::contract [ -object_id object_id ] \
    [ -content content ] [ -title title ] [ -keywords keywords ] \
    [ -community_id community_id ] [ -relevant_date relevant_date ] \
    [ -description description ] [ -datasource datasource ] \
    [ -package_id package_id ]

This callback is invoked from the search::indexer scheduled procedure to add an item to the index

Switches:
-object_id
(optional)
-content
(optional)
-title
(optional)
-keywords
(optional)
-community_id
(optional)
-relevant_date
(optional)
-description
(optional)
-datasource
(optional)
-package_id
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::search::contract (private)

 callback::search::search::contract -query query [ -user_id user_id ] \
    [ -offset offset ] [ -limit limit ] [ -df df ] [ -dt dt ] \
    [ -package_ids package_ids ] [ -object_type object_type ] \
    [ -extra_args extra_args ]

This callback is invoked when a search is to be performed. Query will be a list of lists. The first list is required and will be a list of search terms to send to the full text search engine. Additional optional lists will be a two element list. The first element will be the name of an advanced search operator. The second element will be a list of data to restrict search results based on that operator.

Switches:
-query
(required)
-user_id
(optional)
-offset
(defaults to "0") (optional)
-limit
(defaults to "10") (optional)
-df
(optional)
-dt
(optional)
-package_ids
(optional)
-object_type
(optional)
-extra_args
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::summary::contract (private)

 callback::search::summary::contract [ -query query ] [ -text text ]

This callback is invoked to return an HTML fragment highlighting the terms in query

Switches:
-query
(optional)
-text
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::unindex::contract (private)

 callback::search::unindex::contract -object_id object_id

This callback is invoked to remove an item from the search index.

Switches:
-object_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::update_index::contract (private)

 callback::search::update_index::contract [ -object_id object_id ] \
    [ -content content ] [ -title title ] [ -keywords keywords ] \
    [ -community_id community_id ] [ -relevant_date relevant_date ] \
    [ -description description ] [ -datasource datasource ] \
    [ -package_id package_id ]

This callback is invoked from the search::indexer scheduled procedure to update an item already in the index

Switches:
-object_id
(optional)
-content
(optional)
-title
(optional)
-keywords
(optional)
-community_id
(optional)
-relevant_date
(optional)
-description
(optional)
-datasource
(optional)
-package_id
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

callback::search::url::contract (private)

 callback::search::url::contract -object_id object_id

This callback is invoked when a URL needs to be generated for an object. Usually, this is called from /o.vuh which defers URL calculation until a link is actually clicked, so generating a list of URLs for various object types is quick.

Switches:
-object_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

search::content_filter (private)

 search::content_filter [ -passing_style passing_style ] _txt _data \
    mime
Switches:
-passing_style
(defaults to "string") (optional)
Parameters:
_txt
_data
mime
Author:
Neophytos Demetriou

Partial Call Graph (max 5 caller/called nodes):
%3 search::content_get search::content_get (private) search::content_filter search::content_filter search::content_get->search::content_filter ad_opentmpfile ad_opentmpfile (public) search::content_filter->ad_opentmpfile search::convert::binary_to_text search::convert::binary_to_text (public) search::content_filter->search::convert::binary_to_text

Testcases:
No testcase defined.

search::content_get (private)

 search::content_get _txt content mime storage_type object_id
Parameters:
_txt
content - holds the filename if storage_type=file holds the text data if storage_type=text holds the lob_id if storage_type=lob
mime
storage_type
object_id
Author:
Neophytos Demetriou

Partial Call Graph (max 5 caller/called nodes):
%3 packages/search/www/search.tcl packages/search/ www/search.tcl search::content_get search::content_get packages/search/www/search.tcl->search::content_get search::indexer search::indexer (private) search::indexer->search::content_get content::revision::get_cr_file_path content::revision::get_cr_file_path (public) search::content_get->content::revision::get_cr_file_path db_blob_get db_blob_get (public) search::content_get->db_blob_get search::content_filter search::content_filter (private) search::content_get->search::content_filter

Testcases:
No testcase defined.

search::dequeue (public)

 search::dequeue [ -object_id object_id ] [ -event_date event_date ] \
    [ -event event ]

Remove an object from the search queue

Switches:
-object_id
(optional)
acs_objects object_id
-event_date
(optional)
the event date as retrieved from the DB (and which should not be changed)
-event
(optional)
INSERT or UPDATE or DELETE
Author:
Jeff Davis <davis@xarg.net>

Partial Call Graph (max 5 caller/called nodes):
%3 search::indexer search::indexer (private) search::dequeue search::dequeue search::indexer->search::dequeue ad_print_stack_trace ad_print_stack_trace (public) search::dequeue->ad_print_stack_trace package_exec_plsql package_exec_plsql (public) search::dequeue->package_exec_plsql

Testcases:
No testcase defined.

search::dotlrn::get_community_id (public)

 search::dotlrn::get_community_id -package_id package_id

If dotlrn is installed find the package's community_id

Switches:
-package_id
(required)
Package to find community
Returns:
dotLRN community_id. Empty string if package_id is not under a dotlrn package instance

Partial Call Graph (max 5 caller/called nodes):
%3 apm_package_installed_p apm_package_installed_p (public) db_string db_string (public) site_node::closest_ancestor_package site_node::closest_ancestor_package (public) site_node::get_node_id_from_object_id site_node::get_node_id_from_object_id (public) search::dotlrn::get_community_id search::dotlrn::get_community_id search::dotlrn::get_community_id->apm_package_installed_p search::dotlrn::get_community_id->db_string search::dotlrn::get_community_id->site_node::closest_ancestor_package search::dotlrn::get_community_id->site_node::get_node_id_from_object_id

Testcases:
No testcase defined.

search::driver_name (public)

 search::driver_name

Return the name of the current search driver.

Partial Call Graph (max 5 caller/called nodes):
%3 apm_package_id_from_key apm_package_id_from_key (public) parameter::get parameter::get (public) search::driver_name search::driver_name search::driver_name->apm_package_id_from_key search::driver_name->parameter::get

Testcases:
No testcase defined.

search::extra_args (public)

 search::extra_args

List of extra_args to pass to search::search callback

Partial Call Graph (max 5 caller/called nodes):
%3 search::extra_args_names search::extra_args_names (public) search::extra_args search::extra_args search::extra_args->search::extra_args_names

Testcases:
No testcase defined.

search::extra_args_names (public)

 search::extra_args_names

List of names of extra args implemented

Partial Call Graph (max 5 caller/called nodes):
%3 search::extra_args search::extra_args (public) search::extra_args_names search::extra_args_names search::extra_args->search::extra_args_names search::extra_args_page_contract search::extra_args_page_contract (public) search::extra_args_page_contract->search::extra_args_names

Testcases:
No testcase defined.

search::extra_args_page_contract (public)

 search::extra_args_page_contract

Generate ad_page_contract fragment for extra_args options Get all the callback impls for extra_args and add a page contract declaration

Returns:
string containing the ad_page_contract query declarations for the extra_args that are implemented

Partial Call Graph (max 5 caller/called nodes):
%3 search::extra_args_names search::extra_args_names (public) search::extra_args_page_contract search::extra_args_page_contract search::extra_args_page_contract->search::extra_args_names

Testcases:
No testcase defined.

search::indexer (private)

 search::indexer

Search indexer loops over the existing entries in the search_observer_queue table and calls the appropriate driver functions to index, update, or delete the entry.

Authors:
Neophytos Demetriou
Jeff Davis <davis@xarg.net>

Partial Call Graph (max 5 caller/called nodes):
%3 acs_object_type acs_object_type (public) acs_sc::invoke acs_sc::invoke (public) acs_sc_binding_exists_p acs_sc_binding_exists_p (public) ad_print_stack_trace ad_print_stack_trace (public) apm_package_id_from_key apm_package_id_from_key (public) search::indexer search::indexer search::indexer->acs_object_type search::indexer->acs_sc::invoke search::indexer->acs_sc_binding_exists_p search::indexer->ad_print_stack_trace search::indexer->apm_package_id_from_key

Testcases:
No testcase defined.

search::is_guest_p (public, deprecated)

 search::is_guest_p
Deprecated. Invoking this procedure generates a warning.

Checks whether the logged-in user is a guest Deprecated: returning 0 since more than 10 years...

See Also:
  • acs::dc proc "call dotlrn_privacy guest_p"

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) search::is_guest_p search::is_guest_p search::is_guest_p->ad_log_deprecated

Testcases:
No testcase defined.

search::queue (public)

 search::queue [ -object_id object_id ] [ -event event ]

Add an object to the search_observer_queue table with an event. You should exercise care that the entry is not being created from a trigger (although search is robust for multiple entries so it will not insert or update the same object more than once per sweep).

Switches:
-object_id
(optional)
acs_objects object_id
-event
(optional)
INSERT or UPDATE or DELETE
Author:
Jeff Davis <davis@xarg.net>

Partial Call Graph (max 5 caller/called nodes):
%3 xowiki::Package instproc www-reindex xowiki::Package instproc www-reindex (public) search::queue search::queue xowiki::Package instproc www-reindex->search::queue ad_print_stack_trace ad_print_stack_trace (public) search::queue->ad_print_stack_trace package_exec_plsql package_exec_plsql (public) search::queue->package_exec_plsql

Testcases:
No testcase defined.
[ show source ]