We are in the process of building a custom visual force page whose requirement is to search content libraries and files related to it based on a text entered on a search box. The requirement is to search 100,000 characters inside a file which is associated to a content library based on search text entered in a text box. Can we use SOSL queries to search files inside a content library? Can you guys share custom code or blogs related to custom search within a content library? Thanks Buyan

1 Answer 1


Here is little experiment that I did for this ,

Uploaded a word document(14 pages long) in the Content Object .

enter image description here

The next thing I did was to pick a very random word thats there in the document .

Ran the below SOSL to see if the query searches inside the file


Observe the results below

enter image description here

Looked into docs to find limitations and here is what I gathered

The search engine looks for matches to the search term across a maximum of 2,000 records (this limit starts with API version 28.0).

The search term cannot be greater than 10000 characters

Searching document content supports multiple file types and has file size limits. The contents of documents that exceed the maximum sizes are not searched; however, the document fields are still searched. Only the first 1,000,000 characters of text are searched. Text beyond this limit is not included in the search.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .