Document Library Link content type in search results

%3CLINGO-SUB%20id%3D%22lingo-sub-701406%22%20slang%3D%22en-US%22%3EDocument%20Library%20Link%20content%20type%20in%20search%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-701406%22%20slang%3D%22en-US%22%3E%3CP%3EWe've%20had%20users%20utilizing%20the%20Link%20option%20from%20a%20document%20library's%20New%20content%20menu%20as%20a%20way%20to%20add%20URLs%20to%20external%20resources.%20This%20creates%20a%20.url%20file%20in%20the%20library%2C%20which%20seems%20to%20work%20OK%20in%20many%20cases.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20these%20.url%20items%20are%20returned%20in%20search%2C%20the%20URL%20of%20the%20result%20is%20to%20the%20SharePoint%20location.%20Clicking%20on%20them%20triggers%20a%20security%20warning%20from%20the%20browser%2C%20as%20it%20downloads%20the%20.url%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%3A%20user%20uses%20Link%20option%20to%20add%20%22website.com%22%20in%20Document%20Library.%20When%20this%20item%20is%20returned%20by%20search%2C%20its%20associated%20hyperlink%20is%20%22company.sharepoint.com%2Fsite%2FDocumentLibrary%2Fwebsite.url%22%2C%20when%20logically%2C%20the%20hyperlink%20should%20be%20simply%20%22website.com%22%20for%20this%20type%20of%20content.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20customize%20our%20search%20results%20to%20ensure%20the%20appropriate%20URL%20is%20returned%20by%20search%20for%20this%20type%20of%20content%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-701406%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFiles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-701674%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Link%20content%20type%20in%20search%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-701674%22%20slang%3D%22en-US%22%3EWell%20technically%20all%20that%20link%20is%2C%20is%20a%20shortcut%20file.%20The%20difference%20is%20document%20libraries%20render%20them%20by%20redirecting%20etc.%20and%20search%20just%20doesn%E2%80%99t%20process%20the%20mime%20time%20the%20same%20way.%20It%20would%20be%20nice%20if%20search%20utilized%20the%20same%20viewer%20when%20clicking%20those%20so%20they%20redirect.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1179230%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Link%20content%20type%20in%20search%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1179230%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F362485%22%20target%3D%22_blank%22%3E%40pkoepp%3C%2FA%3E%26nbsp%3B%20how%20did%20you%20get%20them%20to%20appear%20in%20the%20search%20results%3F%20When%20I%20search%20it%20doesn't%20seem%20to%20pick%20up%20the%20Link%20contents%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1424430%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Link%20content%20type%20in%20search%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1424430%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F362485%22%20target%3D%22_blank%22%3E%40pkoepp%3C%2FA%3E%26nbsp%3BDid%20you%20ever%20figure%20this%20out%3F%20Having%20the%20exact%20same%20problem%20now%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1860284%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Link%20content%20type%20in%20search%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860284%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F682545%22%20target%3D%22_blank%22%3E%40yrrgeirs%3C%2FA%3E%26nbsp%3BHi%2C%20how%20were%20you%20able%20to%20setup%20search%20on%20the%20links%20in%20a%20Document%20library%3F%20I%20have%20a%20similar%20requirement%20where%20I%20need%20the%20documents%20as%20well%20as%20the%20links%20in%20a%20Document%20library%20to%20be%20searchable.%20Right%20now%2C%20the%20search%20results%20only%20return%20the%20documents%20and%20not%20the%20links.%20I%20am%20using%20the%20SP%20search%20api.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1860285%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Link%20content%20type%20in%20search%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860285%22%20slang%3D%22en-US%22%3EDid%20you%20figure%20this%20out%3F%20Does%20any%20search%20property%20return%20the%20exact%20url%20of%20the%20created%20link%20(rather%20than%20its%20location%20link%20in%20the%20library)%3F%3C%2FLINGO-BODY%3E
Senior Member

We've had users utilizing the Link option from a document library's New content menu as a way to add URLs to external resources. This creates a .url file in the library, which seems to work OK in many cases.

 

However, when these .url items are returned in search, the URL of the result is to the SharePoint location. Clicking on them triggers a security warning from the browser, as it downloads the .url file.

 

For example: user uses Link option to add "website.com" in Document Library. When this item is returned by search, its associated hyperlink is "company.sharepoint.com/site/DocumentLibrary/website.url", when logically, the hyperlink should be simply "website.com" for this type of content.

 

Is there a way to customize our search results to ensure the appropriate URL is returned by search for this type of content? 

5 Replies
Well technically all that link is, is a shortcut file. The difference is document libraries render them by redirecting etc. and search just doesn’t process the mime time the same way. It would be nice if search utilized the same viewer when clicking those so they redirect.

@pkoepp  how did you get them to appear in the search results? When I search it doesn't seem to pick up the Link contents

@pkoepp Did you ever figure this out? Having the exact same problem now :)

@yrrgeirs Hi, how were you able to setup search on the links in a Document library? I have a similar requirement where I need the documents as well as the links in a Document library to be searchable. Right now, the search results only return the documents and not the links. I am using the SP search api.

Did you figure this out? Does any search property return the exact url of the created link (rather than its location link in the library)?