|
Package search_api |
| Program units |
| Get_Search_Hits_Count | Returns the total hit count |
| Get_Search_Hits_As_Cursor | Returns a cursor with the search hits according to the specified parameters |
| Get_Search_Hits_Page_As_Cursor | Returns the serch results in XML format |
| Get_Search_Hits_As_Xml | Returns the serch results in XML format |
| Get_Search_Page_Hits_As_Xml | Returns the serch results in XML format |
| Get_Search_Page_Hits_As_Xml | Returns the serch results in XML format |
| Get_Html_Highlighted_Doc | Procedure that prepares a HTML version of an indexed document with highlighted search terms |
| Get_Excerpts_For_Keyword | Function that returns an array of highlighted excerpts from a document |
| Get_Sentences_For_Keyword | Function that returns an array of highlighted sentences from a document |
| Show_Search_Page_As_Xml | Shows the search page |
| Exceptions |
| user_not_authorized | Occurs when the user is not authorized |
| Types |
| Fragments_Data | A record that contains a single fragment data |
| Fragments_Table | A table that contains Fragments_Data records |
| Document_Group_Id_List | A table that contains document group ids |
| Document_Group_Name_List | A table that contains document group names |
| Variables |
| tag_begin_keyword | Defines begin tag for higlighting the first keyword in a fragment |
| tag_end_keyword | Defines end tag for higlighting the first keyword in a fragment |
| tag_begin_keyword2 | Defines begin tag for higlighting the next keywords in a fragment |
| tag_end_keyword2 | Defines end tag for higlighting the next keywords in a fragment |
| markup_start_tag | Define markup start tag for higlighting the keywords in a document |
| markup_end_tag | Define markup end tag for higlighting the keywords in a document |
| crlf | The value chr(10) |
| empty_vc_arr | An empty array |
| Constants |
| package_name | Defines the global system name of the application |
| default_hits_per_page | Number of hits per page |
| default_fragment_type | Frgament type: 'SENTENCES' or 'EXCERPT' |
| default_order_by | Default column for ordering the results |
| default_sort_order | Default sort order for ordering the results |
| default_small_fragment_size | Number of characters in a small fragment |
| default_big_fragment_size | Number of characters in a big fragment |
| default_fragments_count | Number of fragments per result |
| default_sentences_count | Number of sentences in big fragment |
| default_chars_before_keyword | Number of characters to get before a keyword in atempt to define a sentence |
| default_chars_after_keyword | Number of characters to get after a keyword in atempt to define a sentence |
| value_date_range | Defines value for the specific keyword 'DATE_RANGE' used in queries |
| value_anytime | Defines value for the specific keyword 'ANYTIME' used in queries |
| value_all | Defines value for the specific keyword 'ALL' used in queries |
| value_least | Defines value for the specific keyword 'AT_LEAST' used in queries |
| value_most | Defines value for the specific keyword 'AT_MOST' used in queries |
package_name
package_name CONSTANT VARCHAR2(20) := 'SEARCH_API';
Defines the global system name of the application
default_hits_per_page
default_hits_per_page CONSTANT NUMBER := 5;
Number of hits per page
default_fragment_type
default_fragment_type CONSTANT VARCHAR2(100) := 'SENTENCES';
Frgament type: 'SENTENCES' or 'EXCERPT'
default_order_by
default_order_by CONSTANT VARCHAR2(100) := 'SCORE';
Default column for ordering the results
default_sort_order
default_sort_order CONSTANT VARCHAR2(4) := 'DESC';
Default sort order for ordering the results
default_small_fragment_size
default_small_fragment_size CONSTANT NUMBER := 50;
Number of characters in a small fragment
default_big_fragment_size
default_big_fragment_size CONSTANT NUMBER := 200;
Number of characters in a big fragment
default_fragments_count
default_fragments_count CONSTANT NUMBER := 5;
Number of fragments per result
default_sentences_count
default_sentences_count CONSTANT NUMBER := 1;
Number of sentences in big fragment
default_chars_before_keyword
default_chars_before_keyword CONSTANT NUMBER := 1000;
Number of characters to get before a keyword in atempt to define a sentence
default_chars_after_keyword
default_chars_after_keyword CONSTANT NUMBER := 1000;
Number of characters to get after a keyword in atempt to define a sentence
tag_begin_keyword
tag_begin_keyword VARCHAR2(20) := '(#b#)';
Defines begin tag for higlighting the first keyword in a fragment
tag_end_keyword
tag_end_keyword VARCHAR2(20) := '(#e#)';
Defines end tag for higlighting the first keyword in a fragment
tag_begin_keyword2
tag_begin_keyword2 VARCHAR2(20) := '(#b2#)';
Defines begin tag for higlighting the next keywords in a fragment
tag_end_keyword2
tag_end_keyword2 VARCHAR2(20) := '(#e2#)';
Defines end tag for higlighting the next keywords in a fragment
value_date_range
value_date_range CONSTANT VARCHAR2(20) := 'DATE_RANGE';
Defines value for the specific keyword 'DATE_RANGE' used in queries
value_anytime
value_anytime CONSTANT VARCHAR2(20) := 'ANYTIME';
Defines value for the specific keyword 'ANYTIME' used in queries
value_all
value_all CONSTANT VARCHAR2(20) := 'ALL';
Defines value for the specific keyword 'ALL' used in queries
value_least
value_least CONSTANT VARCHAR2(10) := 'AT_LEAST';
Defines value for the specific keyword 'AT_LEAST' used in queries
value_most
value_most CONSTANT VARCHAR2(10) := 'AT_MOST';
Defines value for the specific keyword 'AT_MOST' used in queries
markup_start_tag
markup_start_tag VARCHAR2(500) := '';
Define markup start tag for higlighting the keywords in a document
markup_end_tag
markup_end_tag VARCHAR2(050) := '';
Define markup end tag for higlighting the keywords in a document
crlf
crlf VARCHAR(2) := chr(10);
The value chr(10)
user_not_authorized
user_not_authorized EXCEPTION;
Occurs when the user is not authorized
empty_vc_arr
empty_vc_arr owa.vc_arr;
An empty array
Fragments_Data
TYPE Fragments_Data IS RECORD( id NUMBER, big_data VARCHAR2(23768), small_data VARCHAR2(23768));
A record that contains a single fragment data
Fragments_Table
TYPE Fragments_Table IS TABLE OF Fragments_Data;
A table that contains Fragments_Data records
Document_Group_Id_List
TYPE Document_Group_Id_List IS TABLE OF NUMBER;
A table that contains document group ids
Document_Group_Name_List
TYPE Document_Group_Name_List IS TABLE OF VARCHAR2(256);
A table that contains document group names
Get_Search_Hits_Count
Function Get_Search_Hits_Count(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN owa.vc_arr DEFAULT empty_vc_arr,
p_location_type IN owa.vc_arr DEFAULT empty_vc_arr,
p_search_string IN VARCHAR2 DEFAULT '',
p_from_date IN DATE DEFAULT NULL,
p_to_date IN DATE DEFAULT NULL,
p_file_extensions IN VARCHAR2 DEFAULT NULL,
p_file_size_mod IN VARCHAR2 DEFAULT value_least,
p_file_size IN VARCHAR2 DEFAULT '0',
p_file_name IN VARCHAR2 DEFAULT '')
RETURN NUMBER
Returns the total hit count
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
An array of document group ids to filter the search results | |
| p_location_type |
An array of location types to filter the search results | |
| p_search_string |
The string that is used for a search criteria | |
| p_from_date |
Specifies the lower bound to the 'last modified' | |
| p_to_date |
Specifies the upper bound to the 'last modified' | |
| p_file_extensions |
A list of valid file extensions to filter the search results | |
| p_file_size_mod |
The comparison type applied to the file size, where the constants 'value_least' and 'value_most' can be used | |
| p_file_size |
Upper or lower bound (according to the value of p_file_size_mod) of the size of the file | |
| p_file_name |
The name or part of the name of the file(s) |
Get_Search_Hits_As_Cursor
Function Get_Search_Hits_As_Cursor(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN owa.vc_arr DEFAULT empty_vc_arr,
p_location_type IN owa.vc_arr DEFAULT empty_vc_arr,
p_search_string IN VARCHAR2 DEFAULT '',
p_first_hit IN VARCHAR2,
p_last_hit IN VARCHAR2,
p_from_date IN DATE DEFAULT NULL,
p_to_date IN DATE DEFAULT NULL,
p_file_extensions IN VARCHAR2 DEFAULT NULL,
p_file_size_mod IN VARCHAR2 DEFAULT value_least,
p_file_size IN VARCHAR2 DEFAULT '0',
p_file_name IN VARCHAR2 DEFAULT '')
RETURN dbms_sql.varchar2s
Returns a cursor with the search hits according to the specified parameters
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
An array of document group ids to filter the search results | |
| p_location_type |
An array of location types to filter the search results | |
| p_search_string |
The string that is used for a search criteria | |
| p_first_hit |
Specifies the numbers of the first document that will be returned | |
| p_last_hit |
Specifies the numbers of the last document that will be returned | |
| p_from_date |
Specifies the lower bound to the 'last modified' | |
| p_to_date |
Specifies the upper bound to the 'last modified' | |
| p_file_extensions |
A list of valid file extensions to filter the search results | |
| p_file_size_mod |
The comparison type applied to the file size, where the constants 'value_least' and 'value_most' can be used | |
| p_file_size |
Upper or lower bound (according to the value of p_file_size_mod) of the size of the file | |
| p_file_name |
The name or part of the name of the file(s) |
Get_Search_Hits_Page_As_Cursor
Function Get_Search_Hits_Page_As_Cursor(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN owa.vc_arr DEFAULT empty_vc_arr,
p_location_type IN owa.vc_arr DEFAULT empty_vc_arr,
p_search_string IN VARCHAR2 DEFAULT '',
p_page_number IN NUMBER DEFAULT 1,
p_from_date IN DATE DEFAULT NULL,
p_to_date IN DATE DEFAULT NULL,
p_file_extensions IN VARCHAR2 DEFAULT NULL,
p_file_size_mod IN VARCHAR2 DEFAULT value_least,
p_file_size IN VARCHAR2 DEFAULT '0',
p_file_name IN VARCHAR2 DEFAULT '')
RETURN dbms_sql.varchar2s
Returns the serch results in XML format
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
An array of document group ids to filter the search results | |
| p_location_type |
An array of location types to filter the search results | |
| p_search_string |
The string that is used for a search criteria | |
| p_page_number |
The current page number which search hits should be returned | |
| p_from_date |
Specifies the lower bound to the 'last modified' | |
| p_to_date |
Specifies the upper bound to the 'last modified' | |
| p_file_extensions |
A list of valid file extensions to filter the search results | |
| p_file_size_mod |
The comparison type applied to the file size, where the constants 'value_least' and 'value_most' can be used | |
| p_file_size |
Upper or lower bound (according to the value of p_file_size_mod) of the size of the file | |
| p_file_name |
The name or part of the name of the file(s) |
Get_Search_Hits_As_Xml
Function Get_Search_Hits_As_Xml(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN owa.vc_arr DEFAULT empty_vc_arr,
p_location_type IN owa.vc_arr DEFAULT empty_vc_arr,
p_search_string IN VARCHAR2 DEFAULT '',
p_first_hit IN VARCHAR2,
p_last_hit IN VARCHAR2,
p_from_date IN DATE DEFAULT NULL,
p_to_date IN DATE DEFAULT NULL,
p_file_extensions IN VARCHAR2 DEFAULT NULL,
p_file_size_mod IN VARCHAR2 DEFAULT value_least,
p_file_size IN VARCHAR2 DEFAULT '0',
p_file_name IN VARCHAR2 DEFAULT '',
p_show_fragments IN VARCHAR2 DEFAULT 'Y',
p_fragment_type IN VARCHAR2 DEFAULT default_fragment_type,
p_results_count IN NUMBER DEFAULT 0,
p_total_hit_count OUT NUMBER) RETURN CLOB
Returns the serch results in XML format
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
An array of document group ids to filter the search results | |
| p_location_type |
An array of location types to filter the search results | |
| p_search_string |
The string that is used for a search criteria | |
| p_first_hit |
Specifies the numbers of the first document that will be returned | |
| p_last_hit |
Specifies the numbers of the last document that will be returned | |
| p_from_date |
Specifies the lower bound to the 'last modified' | |
| p_to_date |
Specifies the upper bound to the 'last modified' | |
| p_file_extensions |
A list of valid file extensions to filter the search results | |
| p_file_size_mod |
The comparison type applied to the file size, where the constants 'value_least' and 'value_most' can be used | |
| p_file_size |
Upper or lower bound (according to the value of p_file_size_mod) of the size of the file | |
| p_file_name |
The name or part of the name of the file(s) | |
| p_show_fragments |
Indicates whether the text fragments should be shown | |
| p_fragment_type |
Fragment type. Can be 'SENTENCES' or 'EXCERPT' | |
| p_results_count |
This is the total number of the hits found by DirectInfo | |
| p_total_hit_count |
This is the total number of the hits found by DirectInfo |
Get_Search_Page_Hits_As_Xml
Procedure Get_Search_Page_Hits_As_Xml(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_document_group_id_list IN document_group_id_list,
p_search_string IN VARCHAR2,
p_first_hit_number_on_page IN NUMBER,
p_last_hit_number_on_page IN NUMBER,
p_total_hit_count OUT NUMBER,
p_search_page_result_xml OUT CLOB)
Returns the serch results in XML format
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_document_group_id_list |
An array of document group ids | |
| p_search_string |
The string that is used for a search criteria | |
| p_first_hit_number_on_page |
Specifies the numbers of the first document that will be returned | |
| p_last_hit_number_on_page |
Specifies the numbers of the last document that will be returned | |
| p_total_hit_count |
This is the total number of the hits found by DirectInfo | |
| p_search_page_result_xml |
The resulting xml |
Get_Search_Page_Hits_As_Xml
Procedure Get_Search_Page_Hits_As_Xml(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_document_group_name_list IN document_group_name_list,
p_search_string IN VARCHAR2,
p_first_hit_number_on_page IN NUMBER,
p_last_hit_number_on_page IN NUMBER,
p_total_hit_count OUT NUMBER,
p_search_page_result_xml OUT CLOB)
Returns the serch results in XML format
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_document_group_name_list |
An array of document group names | |
| p_search_string |
The string that is used for a search criteria | |
| p_first_hit_number_on_page |
Specifies the numbers of the first document that will be returned | |
| p_last_hit_number_on_page |
Specifies the numbers of the last document that will be returned | |
| p_total_hit_count |
This is the total number of the hits found by DirectInfo | |
| p_search_page_result_xml |
The resulting xml |
Get_Html_Highlighted_Doc
Procedure Get_Html_Highlighted_Doc(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_group_id IN NUMBER,
p_key IN VARCHAR2,
p_query IN VARCHAR2,
p_prevtag IN VARCHAR2,
p_nexttag IN VARCHAR2,
p_result IN OUT CLOB)
Procedure that prepares a HTML version of an indexed document with highlighted search terms
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_group_id |
The id of the document group | |
| p_key |
The document for which to produce highlights; | |
| p_query |
The query | |
| p_prevtag |
The navigate to previous highlight mark-up tag | |
| p_nexttag |
The navigate to next highlight mark-up tag | |
| p_result |
The highlighted result |
Get_Excerpts_For_Keyword
Function Get_Excerpts_For_Keyword(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN VARCHAR2,
p_key IN VARCHAR2,
p_query IN VARCHAR2,
p_number_symbols_before IN NUMBER,
p_number_symbols_after IN NUMBER,
p_small_number_symbols_before IN NUMBER,
p_small_number_symbols_after IN NUMBER,
p_number_fragments IN NUMBER,
p_begin_tag_for_hightlight IN VARCHAR2,
p_end_tag_for_hightlight IN VARCHAR2,
p_begin2_tag_for_hightlight IN VARCHAR2,
p_end2_tag_for_hightlight IN VARCHAR2)
RETURN fragments_table
Function that returns an array of highlighted excerpts from a document
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
The id of the document group | |
| p_key |
The document for which to produce highlights; | |
| p_query |
The query | |
| p_number_symbols_before |
The number of symbols before the query used to build the big_data values of the result | |
| p_number_symbols_after |
The number of symbols after the query used to build the big_data values of the result | |
| p_small_number_symbols_before |
The number of symbols before the query used to build the small_data values of the result | |
| p_small_number_symbols_after |
The number of symbols after the query used to build the small_data values of the result | |
| p_number_fragments |
The number of text fragments | |
| p_begin_tag_for_hightlight |
The begin tag of the text that should be highlighted | |
| p_end_tag_for_hightlight |
The end tag of the text that should be highlighted | |
| p_begin2_tag_for_hightlight |
The begin tag2 of the text that should be highlighted | |
| p_end2_tag_for_hightlight |
The end tag2 of the text that should be highlighted |
Get_Sentences_For_Keyword
Function Get_Sentences_For_Keyword(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN VARCHAR2,
p_key IN VARCHAR2,
p_query IN VARCHAR2,
p_number_symbols_before IN NUMBER,
p_number_symbols_after IN NUMBER,
p_number_fragments IN NUMBER,
p_begin_tag_for_hightlight IN VARCHAR2,
p_end_tag_for_hightlight IN VARCHAR2,
p_begin2_tag_for_hightlight IN VARCHAR2,
p_end2_tag_for_hightlight IN VARCHAR2,
p_sentences_count IN NUMBER)
RETURN fragments_table
Function that returns an array of highlighted sentences from a document
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
The id of the document group | |
| p_key |
The document for which to produce highlights; | |
| p_query |
The query | |
| p_number_symbols_before |
The number of symbols before the query used to build the big_data values of the result | |
| p_number_symbols_after |
The number of symbols after the query used to build the big_data values of the result | |
| p_small_number_symbols_before |
The number of symbols before the query used to build the small_data values of the result | |
| p_small_number_symbols_after |
The number of symbols after the query used to build the small_data values of the result | |
| p_number_fragments |
The number of text fragments | |
| p_begin_tag_for_hightlight |
The begin tag of the text that should be highlighted | |
| p_end_tag_for_hightlight |
The end tag of the text that should be highlighted | |
| p_begin2_tag_for_hightlight |
The begin tag2 of the text that should be highlighted | |
| p_end2_tag_for_hightlight |
The end tag2 of the text that should be highlighted | |
| p_sentences_count |
The number of sentences |
Show_Search_Page_As_Xml
Procedure Show_Search_Page_As_Xml(p_username IN VARCHAR2,
p_password IN VARCHAR2,
p_item_id IN owa.vc_arr DEFAULT empty_vc_arr,
p_search_string IN VARCHAR2 DEFAULT '',
p_first_hit_number_on_page IN NUMBER DEFAULT 1,
p_last_hit_number_on_page IN NUMBER DEFAULT default_hits_per_page)
Shows the search page
| Parameters |
| p_username |
The name of the directinfo user that is used for authorisation | |
| p_password |
The password of the directinfo user that is used for authorisation | |
| p_item_id |
An array of document group ids | |
| p_search_string |
Provides the string that is used for a search criteria | |
| p_first_hit_number_on_page |
Specifies the number of the first document that will be returned by the procedure | |
| p_last_hit_number_on_page |
Specifies the number of the last document that will be returned by the procedure |