function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SidzSidz 

unable to get data from SOSL query on Knowledge Objects

hi,

i am trying to retrieve the search result data but i always end up with some exception

 

query1:

FIND 'map*' IN ALL FIELDS RETURNING Developer__kav (id)

Compile Error: line 1, column 14: Implementation restriction: When querying or searching the Developer__kav object, you must filter using the following syntax: Id = [single ID], Id IN [list of ID's] or PublishStatus = [status]. In addition PublishStatus is only permitted in a top-level AND condition.

 

now i have added the PublishStatus='Online'

query2:

system.debug([FIND 'map*' IN ALL FIELDS RETURNING Developer__kav (id) where PublishStatus='Online' ]);

Compile Error: line 1, column 70: expecting right square bracket, found 'where'

 

 

i have configured my sandbox demo in the eclipse and tried to access the data from the article object 

but i get this error

 

 

unable to open SchemaBrowse.
Reason:
Malformed_query - Implementation restricition: when 
querying or searching the test__kav object,you must filter using the fo

 

unable to open SchemaBrowser.

 

Reason:Malformed_query - Implementation restriction: When querying or searching the Developer__kav object, you must filter using the following syntax: Id = [single ID], Id IN [list of ID's] or PublishStatus = [status]. In addition PublishStatus is only permitted in a top-level AND condition.

 

please help me fix this

Best Answer chosen by Admin (Salesforce Developers) 
Aashay DesaiAashay Desai

Put the "Where" Clause on the inside of the parenthesis.  So, like this:

 

FIND 'map*' IN ALL FIELDS RETURNING Developer__kav (id where PublishStatus='Online')

All Answers

Aashay DesaiAashay Desai

Put the "Where" Clause on the inside of the parenthesis.  So, like this:

 

FIND 'map*' IN ALL FIELDS RETURNING Developer__kav (id where PublishStatus='Online')

This was selected as the best answer
SidzSidz

thanks a lot it worked :)