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.64 2024/12/17 17:32:51 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):

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):

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):

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):

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):

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 (optional, defaults to "0")
-limit (optional, defaults to "10")
-df (optional)
-dt (optional)
-package_ids (optional)
-object_type (optional)
-extra_args (optional)

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

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):

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):

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):

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):

Testcases:
No testcase defined.

search::content_filter (private)

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

Partial Call Graph (max 5 caller/called nodes):
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 (required)
content (required)
holds the filename if storage_type=file holds the text data if storage_type=text holds the lob_id if storage_type=lob
mime (required)
storage_type (required)
object_id (required)
Author:
Neophytos Demetriou

Partial Call Graph (max 5 caller/called nodes):
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::object_index search::object_index (public) search::object_index->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):
test_queue_dequeue queue_dequeue (test search) search::dequeue search::dequeue test_queue_dequeue->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 search::indexer search::indexer (private) search::indexer->search::dequeue

Testcases:
queue_dequeue

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):
test_misc misc (test search) search::dotlrn::get_community_id search::dotlrn::get_community_id test_misc->search::dotlrn::get_community_id apm_package_installed_p apm_package_installed_p (public) search::dotlrn::get_community_id->apm_package_installed_p db_string db_string (public) search::dotlrn::get_community_id->db_string site_node::closest_ancestor_package site_node::closest_ancestor_package (public) search::dotlrn::get_community_id->site_node::closest_ancestor_package site_node::get_node_id_from_object_id site_node::get_node_id_from_object_id (public) search::dotlrn::get_community_id->site_node::get_node_id_from_object_id

Testcases:
misc

search::driver_name (public)

 search::driver_name

Return the name of the current search driver.

Partial Call Graph (max 5 caller/called nodes):
test_misc misc (test search) search::driver_name search::driver_name test_misc->search::driver_name acs_sc_binding_exists_p acs_sc_binding_exists_p (public) search::driver_name->acs_sc_binding_exists_p apm_package_id_from_key apm_package_id_from_key (public) search::driver_name->apm_package_id_from_key callback::impl_exists callback::impl_exists (public) search::driver_name->callback::impl_exists parameter::get parameter::get (public) search::driver_name->parameter::get search::indexer search::indexer (private) search::indexer->search::driver_name search::object_index search::object_index (public) search::object_index->search::driver_name search::object_unindex search::object_unindex (public) search::object_unindex->search::driver_name

Testcases:
misc

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):
test_extra_args extra_args (test search) search::extra_args search::extra_args test_extra_args->search::extra_args search::extra_args_names search::extra_args_names (public) search::extra_args->search::extra_args_names

Testcases:
extra_args

search::extra_args_names (public)

 search::extra_args_names

List of names of extra args implemented

Partial Call Graph (max 5 caller/called nodes):
test_extra_args extra_args (test search) search::extra_args_names search::extra_args_names test_extra_args->search::extra_args_names search::extra_args search::extra_args (public) 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:
extra_args

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):
test_extra_args extra_args (test search) search::extra_args_page_contract search::extra_args_page_contract test_extra_args->search::extra_args_page_contract search::extra_args_names search::extra_args_names (public) search::extra_args_page_contract->search::extra_args_names

Testcases:
extra_args

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):
acs_object_type acs_object_type (public) ad_print_stack_trace ad_print_stack_trace (public) db_exec_plsql db_exec_plsql (public) db_list_of_lists db_list_of_lists (public) search::dequeue search::dequeue (public) search::indexer search::indexer search::indexer->acs_object_type search::indexer->ad_print_stack_trace search::indexer->db_exec_plsql search::indexer->db_list_of_lists search::indexer->search::dequeue

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):
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::object_datasource (public)

 search::object_datasource -object_id object_id

Obtains the datasource for an object by invoking the proper datasource and callbacks.

Switches:
-object_id (required)
Returns:
datasource as dict

Partial Call Graph (max 5 caller/called nodes):
test_object_utilities object_utilities (test search) search::object_datasource search::object_datasource test_object_utilities->search::object_datasource acs_object_type acs_object_type (public) search::object_datasource->acs_object_type acs_sc::invoke acs_sc::invoke (public) search::object_datasource->acs_sc::invoke callback callback (public) search::object_datasource->callback callback::impl_exists callback::impl_exists (public) search::object_datasource->callback::impl_exists search::searchable_type_p search::searchable_type_p (public) search::object_datasource->search::searchable_type_p packages/search/www/search.tcl packages/search/ www/search.tcl packages/search/www/search.tcl->search::object_datasource search::object_index search::object_index (public) search::object_index->search::object_datasource

Testcases:
object_utilities

search::object_index (public)

 search::object_index -object_id object_id [ -event event ]

Indexes an object by invoking the proper datasource and callbacks.

Switches:
-object_id (required)
-event (optional, defaults to "UPDATE")
Returns:
datasource as dict

Partial Call Graph (max 5 caller/called nodes):
test_object_utilities object_utilities (test search) search::object_index search::object_index test_object_utilities->search::object_index acs_object_type acs_object_type (public) search::object_index->acs_object_type acs_sc::invoke acs_sc::invoke (public) search::object_index->acs_sc::invoke callback callback (public) search::object_index->callback callback::impl_exists callback::impl_exists (public) search::object_index->callback::impl_exists search::content_get search::content_get (private) search::object_index->search::content_get search::indexer search::indexer (private) search::indexer->search::object_index

Testcases:
object_utilities

search::object_unindex (public)

 search::object_unindex -object_id object_id

Unindexes an object by invoking the proper callbacks.

Switches:
-object_id (required)

Partial Call Graph (max 5 caller/called nodes):
test_object_utilities object_utilities (test search) search::object_unindex search::object_unindex test_object_utilities->search::object_unindex acs_sc::invoke acs_sc::invoke (public) search::object_unindex->acs_sc::invoke callback callback (public) search::object_unindex->callback search::driver_name search::driver_name (public) search::object_unindex->search::driver_name search::indexer search::indexer (private) search::indexer->search::object_unindex

Testcases:
object_utilities

search::object_url (public)

 search::object_url -object_id object_id

Retrieves the object URL by invoking the proper callbacks.

Switches:
-object_id (required)
Returns:
URL

Partial Call Graph (max 5 caller/called nodes):
test_object_utilities object_utilities (test search) search::object_url search::object_url test_object_utilities->search::object_url acs_object_type acs_object_type (public) search::object_url->acs_object_type acs_sc::invoke acs_sc::invoke (public) search::object_url->acs_sc::invoke callback callback (public) search::object_url->callback callback::impl_exists callback::impl_exists (public) search::object_url->callback::impl_exists packages/search/www/search.tcl packages/search/ www/search.tcl packages/search/www/search.tcl->search::object_url

Testcases:
object_utilities

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):
test_queue_dequeue queue_dequeue (test search) search::queue search::queue test_queue_dequeue->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 xowiki::Package instproc www-reindex xowiki::Package instproc www-reindex (public) xowiki::Package instproc www-reindex->search::queue

Testcases:
queue_dequeue

search::searchable_type_p (public)

 search::searchable_type_p -object_type object_type

Is this object type searchable?

Switches:
-object_type (required)
Returns:
boolean

Partial Call Graph (max 5 caller/called nodes):
test_object_utilities object_utilities (test search) search::searchable_type_p search::searchable_type_p test_object_utilities->search::searchable_type_p acs_sc_binding_exists_p acs_sc_binding_exists_p (public) search::searchable_type_p->acs_sc_binding_exists_p callback::impl_exists callback::impl_exists (public) search::searchable_type_p->callback::impl_exists search::object_datasource search::object_datasource (public) search::object_datasource->search::searchable_type_p

Testcases:
object_utilities
[ show source ]