cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Text Mining Problem

Former Member
0 Kudos

Hi guys,

I don't know if this is the correct place to ask this question, but I need your help.

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 L...)


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

Accepted Solutions (1)

Accepted Solutions (1)

Ian_Henry
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes, I see the issue.

Text Mining via SQL was available with HANA from SPS10 on-wards, you are on SPS09.

Former Member
0 Kudos

Thanks Ian, that was the issue. I am going to upgrade my system to SPS10 from SPS09.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks Ian for the lightning-fast answer!

Antoine

Answers (1)

Answers (1)

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I am not an expert in this & therefore I cannot help. I am looping two spaces, and , hoping that someone more qualified can address your question.

On a side-note, there will be a openSAP on Text Analytics & HANA starting in January, this might be of interest for you: http://scn.sap.com/community/opensap/blog/2015/11/24/text-analytics-with-sap-hana-platform

Best regards,

Antoine

Former Member
0 Kudos

Thanks Antoine for your reply. Hopefully someone from these spaces can help me.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

I know and are experienced in this topic. Maybe one of them can provide you some guidance.

Best regards

Antoine