on 07-09-2014 2:30 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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);
}());
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.