cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing Word Document files using TREX in ABAP

anand_nidamanuru
Active Participant
0 Kudos

Hello All,

We are using TREX Search in ABAP Code.

The TREX Server is present in another server and we call the TREX Function modules using RFC.

The procedure we follow to search is

1) Create Index using TREX_EXT_CREATE_INDEX

2) Index the data using TREX_EXT_INDEX (and call TREX_EXT_OPTIMIZE after indexing)

3) Search using TREX_EXT_SEARCH_DOCUMENTS

We were able to successfully index and search if the index is used for plain Text data. The index data is

doc_key = 'Test1'.

doc_type = 'A'. "A for ASCII

doc_langu = 'EN'.

content = "Text String"

So using the doc_type = 'A' we are able to index and then finally search.

However we want to use TREX for search in Word documents.

We retrieved the document content into a character string (the binary data of document is converted to character string) and passed to TREX index as Content (field content).

Below is the input that we are giving

doc_key = 'Test1'.

doc_type = 'F'. "We tried all variations 'B', 'E' etc

doc_langu = 'EN'.

mime_type = 'application/msword'.

content = lv_data_str.

The lv_data_str has the document content as string.

When we give 'B' as document type, there is no UTF conversion happening, but the TREX FM TREX_EXT_INDEX internally converting it to Binary.

At this point all the data is lost.

But if we give other than 'A' (ASCII) or 'B', we get a code page conversion error.

Can anyone please help as how to give the basic input for word documents so that indexing happens.

Thanks,

Anand

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi, i have the same requirement, can you tell me how did you get the document contents into a string ?

KarstenH
Advisor
Advisor
0 Kudos

Hi all,

correct as far as the TREX engine APIs are concerend: no programming against these supported.

The interfaces for either federating (meta-searching) other search engines or for indexing 3rd party repositories are located in SAP NW Enterprise Search and in SAP Portal's KM. These, however, are two separate approaches.

Best, Karsten

Former Member
0 Kudos

Hi Anand,

My current understanding is that SAP does not support or document programming against TREX engine APIs.

You might want to check the following [thread|; discussing similar requirements, with comments by SAP (Karsten Hohage).

Hope this helps.

Best Regards,

Joseph