Hierarchy
⤷ BC-SRV-SEN (Application Component) ABAP Search Engine for ERP Solution Database
⤷ SRTV (Package) Natural Language Text Retrieval: Core functions
Basic Data
Data Element | SRTVCBLANG |
Short Description | Text Retrieval: Callback for Lang.-Specific Text Processing |
Data Type
Category of Dictionary Type | D | Domain |
Type of Object Referenced | No Information | |
Domain / Name of Reference Type | FUNCNAME | |
Data Type | CHAR | Character String |
Length | 30 | |
Decimal Places | 0 | |
Output Length | 30 | |
Value Table | TFDIR |
Further Characteristics
Search Help: Name | ||
Search Help: Parameters | ||
Parameter ID | LIB | |
Default Component name | ||
Change document | ||
No Input History | ||
Basic direction is set to LTR | ||
No BIDI Filtering |
Field Label
Length | Field Label | |
Short | 10 | Lang.Proc. |
Medium | 15 | Language Proc. |
Long | 30 | Language-Specific Processing |
Heading | 30 | Language-Specific Processing |
Documentation
Definition
Name of a callback which can be used for language-specific text preprocessing.
Use
The callback has the following parameters:
- IMPORTING
- REFERENCE(ID_CORPUS) TYPE SRTVCORPID
- REFERENCE(ID_LANGU) TYPE SRTVLANGU
- CHANGING
- REFERENCE(CT_TEXT) TYPE SRTV_DOC_TEXT
- REFERENCE(CP_INFLENGTH) TYPE SRTVINFLEN
- REFERENCE(CP_MINWORDLEN) TYPE SRTVMINWLN
- REFERENCE(CP_CONVSTRING) TYPE SRTVCNVSTR
- REFERENCE(CP_MAXLEVDIST) TYPE SRTVLEVMAX
- REFERENCE(CD_SEARCH_OPT) TYPE X
The two using parameters identify the search engine index and the language.
The callback can be used at the following times:
- Compilation
When used at this time, the callback obtains one by one the texts of the documents in the form of table ct_text (the type is defined in type pool SRTV).
- Search
In this case, table ct_text contains the query text.
The callback is called at the very beginning of index creation (during compilation) or at the very beginning of the search process.
The following changing parameters are also passed and can be modified as required:
- Inflection length
(CP_INFLENGTH) is used in the search method Word Stem during retrieval.
- Minimum word length
(CP_MINWORDLEN) and the string for character conversion (CP_CONVSTRING) are used during search and also compilation.
- Levenshtein distance
This influences the accuracy of the results of the search method Phonetic.
- CD_SEARCH_OPT
This parameter determines which search methods are used during the retrieval (search) process (see below).
For each search method, the following constant is defined in the same SRTV type pool:
- srtv_strict_search for the search method Attribute
- srtv_similar_search for the search method Word Stem
- srtv_associate_search for the search method Word Within Word
- srtv_phonetic_search for the search method Phonetic
The following example is for the search method Word Stem (using srtv_similar_search). However, it can easily be applied to the other search methods.
- The following coding checks if the search method Word Stem is activated:
data: lt_search(1) type x.
lt_search = cd_search_opt bit-and srtv_similar_search.
if lt_search = srtv_similar_search ."is the SIMILAR SEARCH switched on? - To ensure that the search method Word Stem is activated, the following line has to be inserted:
cd_search_opt = cd_search_opt bit-or srtv_similar_search.
- To ensure that the search method Word Stem is deactivated, the following lines have to be inserted:
data: lt_search(1) type x.
lt_search = bit-not srtv_similar_search.
cd_search_opt = cd_search_opt bit-and lt_search.
The modifications made to parameter cd_search_opt for one method will not affect the use of the other methods.
Note
The search method Attribute cannot be activated/deactivated from within the callback, even if parameter cd_search_opt is modified accordingly.
Exceptions can be raised by this callback, and will be taken into account (that is, they interrupt the search process and determine the skipping of the particular document during compilation).
Dependencies
Examples
History
Last changed by/on | SAP | 20010220 |
SAP Release Created in | 610 |