+ 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?