SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When performing a FullTextSQLQuery against my SharePoint site's document library and retrieving field 'Path', I occasionally get the likes of "Forms/DispForm.aspx?ID=45" returned at the end of a record's Path field. Instead of this - I want the url of the file (deemac.pdf for example). What field do I instead to refer to?

share|improve this question
up vote 5 down vote accepted

SharePoint Search will return the url to the document in Path when it thinks a file is a document (isDocument == 1), but if the file isn't a recognized file type SharePoint will treat it as a list item and return the url of the display form in Path.

You can add support for more file types by adding IFilters (see here for PDF: How to configure PDF iFilter for SharePoint Server 2010 or Search Server 2010) or just add the file type as described in How to add a file type to the content index in SharePoint 2010

You should also consider using KeywordQuery instead of FullTextSQLQuery as this isn't supported when using FAST search or in SharePoint 2013

share|improve this answer
Perfect, just what I Was after. – JᴀʏMᴇᴇ Oct 30 '12 at 19:45
Note that you may need a restart after adding file types and of course a full crawl – Per Jakobsen Oct 30 '12 at 19:53

Try with FileName field as follow:

select Title, Path, Filename from scope()

Hope it helps!! :)

It it's not then I believe, u have to go through the steps Per Jakobsen has mentioned above.

share|improve this answer
+1 - thanks a lot for your suggestion, but when this problem occurs (i.e. path ends in dispform.aspx) - the filename is simply DispForm.aspx. Thanks again. – JᴀʏMᴇᴇ Nov 4 '12 at 12:38

FileRef will give you the URL of file

FileDirRef will give you path of folder the file exists in

and FileLeafRef is the name of the file!

Hope this helps!

share|improve this answer
'Property doesn't exist' on all of them. – JᴀʏMᴇᴇ Oct 29 '12 at 12:22

What you are looking at IS the URL needed. Forms/DispForm.aspx?ID=45 Let's break that URL down. "Forms/" It's a form. "DispForm.aspx" That's the form used to display results; which is what the search spider used. But with out an ID entry, you won't get any form results, just the form. "?ID=45" that's the particular form results to pull up and display.

So simply put, what you got IS the URL needed to display the results. What is being shown is the result of a form submission.

share|improve this answer
Ultimately - where I'm going with this is that I need the filetype. .pdf, .jpeg etc. I've got the ID as you mentioned - so for now I have the work around in place of taking the id and GetItem in the documents list using that ID. But it is a work around - one that I'm not happy with for obvious reasons. Thanks a lot for your reply. +1. – JᴀʏMᴇᴇ Oct 30 '12 at 19:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.