Skip to main content

When i use below type of query in SOQL in apex it is failing

 

select v.score__c as Score, c.chunk__c as Chunk from vector_search(TABLE(Resort_Information_index_dlm), 'what is canecl policy', '', 10) v join Resort_Information_chunk_dlm c on v.RecordId__c = c.Recordid__c order by Score desc 10

 

It gives error

->  System.QueryException: unexpected token: '('

 

I have adopted this from RAG, example

-> https://www.youtube.com/watch?v=ZBDv4tDfzW4

The same works in data cloud editor.

 

Please let me know if there is any solution.

3 respostas
  1. 3 de dez. de 2024, 04:21

    @Ramesh Belavadi,

    To achieve similar functionality, you can break down the process into multiple steps using Apex. For example, You Could Use an Apex method to perform the vector search and retrieve the results, then use the results from the vector search to query the related Resort_Information_chunk_dlm records. Combine the results in Apex to achieve the desired output.