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
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 )
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)
Thanks,
Inanc