When I upload & publish a document through Sitefinity Backend, the search widget returns the uploaded document.
When I do the same pro-grammatically, as I have a form that the user will fill in through a front-end page & will upload a document from there which i then upload & publish to the Document Library of Sitefinity through custom code, the search widget does not return that document(.docx, txt files).
When I manually unpublish the document uploaded programmatically & re-publish it through Sitefinity Backend, the document then appears in the search index results.
Why is that happening? I am uploading the document through normal procedure & its even in published state, why is it not being returned by Search Index when I upload it through LibrariesManager api through custom controller code.
Any help would be appreciated, we are using out-of-the box search service of Sitefinity. Sitefinity version is 8.2