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
zaidyzaidy 

SOSL in documents

Hi, 

I read some where that SOSL will allow you to search on documents and to use a * and ? for search terms. What I am not sure is  what type of documents are supported and how does it works on a combination of * and ?. Example, the following query: 

for(Document doc:(List<Document>)[FIND '*dfgdfg*' IN ALL FIELDS RETURNING Document(id)][0]){

}

 will return all the documents on my org (including PDF, word, txt), which BTW does not contain a string 'dfgdfg' or any other string that contains 'dfgdfg'.

 

In the other hand, if I remove the * (wild card) symbol it returns nothing, which is what I expected. Also I get a correct answer if I search any term without the * (wild card) symbol.

 

Is this a bug or just should not be used in this way?