Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

HANA Text Mining Problem

$
0
0

Hi guys,

 

I am trying to call a text mining function which is "TM_GET_RELATED_DOCUMENTS" for getting the most related documents to a specific document. But I am having "incorrect syntax" error while processing. Here is the steps that I follow from beginning:

 

I have a table named "inancTrialTrain" in "SYSTEM" schema to be used for text mining. The definition of this table as follows

2015-12-14 04-09-32 SAP HANA Development - inancTrialTrain  System: HDB  Host: 52.30.98.20  Instance: 00  Connected User: S.png

And then, I created fulltext index on this table on "text" column as follows


DROP FULLTEXT INDEX "SYSTEM"."INDEX_INANCTRIALTRAIN";  
CREATE FULLTEXT INDEX INDEX_INANCTRIALTRAIN ON "SYSTEM"."inancTrialTrain" ("text")  
ASYNC  
FAST PREPROCESS OFF  
SEARCH ONLY OFF  
TEXT ANALYSIS ON  
CONFIGURATION 'LINGANALYSIS_FULL'  
TEXT MINING ON  
LANGUAGE DETECTION ('EN')  
;  
MERGE DELTA OF "SYSTEM"."inancTrialTrain";

Everything seems fine until this point. I manage to create index table, and it seems good as you can see in the following pic (please do not try to understand tokens, they are in turkish )

2015-12-14 04-18-16 SAP HANA Development -  Users inanc Documents Software eclipse_SAP_HANA Eclipse.app Contents MacOS SQL .png

Now, I am trying to call TM_GET_RELATED_DOCUMENTS as follow (reference is Advanced Data Processing: TM_GET_RELATED_DOCUMENTS - SAP HANA SQL and System Views Reference - SAP Library)


SELECT *  
FROM TM_GET_RELATED_DOCUMENTS (  
DOCUMENT 'some text here'  
SEARCH "text" FROM "SYSTEM"."inancTrialTrain"  
RETURN   
TOP 16  
"id", "text"  
) AS T;  

I got this error:

Could not execute 'SELECT * FROM TM_GET_RELATED_DOCUMENTS ( DOCUMENT 'some text here' SEARCH "text" FROM ...'

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "some text here": line 3 col 10 (at pos 51)


If I call this function as follow (reference is (Time: 3:56) SAP HANA Academy - Text Mining: Using SQL to access Text Mining Functions [SPS 10] - YouTube)


SELECT *  
FROM TM_GET_RELATED_DOCUMENTS (  
DOCUMENT IN FULLTEXT INDEX WHERE "id"=1  
SEARCH "text" FROM "SYSTEM"."inancTrialTrain"  
RETURN   
TOP 16  
"id", "text"  
) AS T; 

I got this error:

Could not execute 'SELECT * FROM TM_GET_RELATED_DOCUMENTS ( DOCUMENT IN FULLTEXT INDEX WHERE "id"=1 SEARCH "text" FROM ...'

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "IN": line 3 col 10 (at pos 51)


I don't understand why this syntax error occurs. I hope one of you guys can help me to figure this out. Additionally here is the general information of my HANA System. Maybe my SPS revision is the problem (although I don't think so)

2015-12-14 04-33-47 SAP HANA Development - System: HDB  Host: 52.30.98.20  Instance: 00  Connected User: SYSTEM  System Usa.png


Thanks,

Inanc


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>