title: Alfresco: how to search for links (nodes of type app:filelink or cm:link) in Alfresco Share?
body: <p>I'm on Alfresco 4.0.2 and want to be able to <strong>search for nodes of types</strong> cm:content as well <strong>as cm:link or app:filelink</strong>.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>I have looked at <strong>search.lib.js</strong> (/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.</p>
  
  <pre><code>  // ensure a TYPE is specified - if no add one to remove system objects from result sets
    if (ftsQuery.indexOf("TYPE:\"") === -1 &amp;&amp; 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")';
    }
  </code></pre>
  
  <p>Where does Alfresco filter out certain search results, such as specific types?</p>
  
  <p><strong>Update:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/zDNCW.png" alt="enter image description here"></p>
  
  <p>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.</p>