I'm on Alfresco 4.0.2 and want to be able to search for nodes of types cm:content as well as cm:link or app:filelink.
When I look directly into the Solr index, I see that all types are indexed there. But when I search within Alfresco Share, link (nodes of type cm:link or app:filelink) are not returned, even though the search term is in their cm:name property, same as it's cm:content equivalent. I checked this in the node browser.
Both cm:content as well as cm:link have cm:cmobject as it's parent and the cm:name property is set to be indexed, which works in Solr.
Therefore, somewhere between Solr and the response returned to the client, Alfresco is doing some filtering and excluding links, I assume. I try to find the relevant code, but have not yet been successful.
I have looked at search.lib.js (/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/search/search.lib.js) and found one spot which I thought could be relevant, changed it (see out-commented line below) and reloaded the web scripts, but it still does not have the result I am looking to achieve. Still, only cm:content and cm:folder types are displayed.
// ensure a TYPE is specified - if no add one to remove system objects from result sets
if (ftsQuery.indexOf("TYPE:\"") === -1 && ftsQuery.indexOf("TYPE:'") === -1)
{
//ftsQuery += ' AND (+TYPE:"cm:content" +TYPE:"cm:folder")';
ftsQuery += ' AND (+TYPE:"cm:content" +TYPE:"cm:folder" +TYPE:"cm:link" +TYPE:"app:filelink")';
}
Where does Alfresco filter out certain search results, such as specific types?
Update:

when I search by name through the Javascript console, all types are included in the search results (in my case, three results). This is the result that I would also like to achieve through the regular Share site search. The highlighted result is the node that does not appear in the regular Alfresco Share search results.