cancel
Showing results for 
Search instead for 
Did you mean: 

Full Text Index in Delivery Units

michael_jess
Participant
0 Kudos

Hi,

is there a way to include full text index definitions on custom columns (i.e., neither TEXT nor SHORTTEXT) in delivery units?

Best,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm afraid that currently there is no way to include the indexes in the delivery unit yet.  The extended syntax to define full text indexes within HDBDD/CDS is in the plans but not yet available.  Until then applications will often check at runtime if the full text index exists and if not create it then.

michael_jess
Participant
0 Kudos

Hi Thomas,

Can you give any information on when this is going to be supported?

Best,

Michael

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No. I can only say that it is in our product backlog and has already been designed. It wouldnt come before SPS09 in December but could also come later than that.

michael_jess
Participant
0 Kudos

Hi Thomas,

How would applications create the index dynamically? We have some scheduled stored procedures, so I thought this would be a good starting point. But it seems like this is not possible:


SAP DBTech JDBC: [257] (at 1823): sql syntax error: CREATE INDEX is not allowed in SQLScript: line 47 col 2 (at pos 1823)

Thanks,

Michael

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In SHINE content we do this from XSJS.  This service call is done from the UI on each new load. If the FULLTEXT Index doesn't exist it creates it.


(function (){

    'use strict';

    //initialize variables

    var conn = null,

        body = '',

        prepStat = null;

    //initial database setup, create fulltext indizes

    try {

        //get connection

        conn = $.db.getConnection();

        // --- epm_texts

        prepStat = conn.prepareStatement('CREATE FULLTEXT INDEX TEXTS_INDEX ON "SAP_HANA_EPM_NEXT"."sap.hana.democontent.epmNext.data::EPM.Util.Texts"("TEXT")');

        prepStat.execute();

        prepStat.close();

        // --- commit changes and close connection

        conn.commit();

        conn.close();

        body = 'ok';

        $.response.status = $.net.http.OK;

    }

    catch (e){

        // 289: index already exists, thats ok

        if(e.code && e.code !== 289){

            body = e.message;

            $.response.status = $.net.http.BAD_REQUEST;

        } else {

            body = 'exists';

            $.response.status = $.net.http.NOT_MODIFIED;

        }

    }

    $.response.contentType = 'text/plain';

    $.response.setBody(body);

}());

Answers (0)