Windows Search using OLE DB SQL Fields
Asked Answered
L

3

7

I need to use Windows Search within my .NET application to search for certain files containing certain keywords. All of this seams easy enough using OLE DB to connect to the Windows Search data store on Windows 7.

I have what I hope is a seriously easy question. I have been searching high and low for the field definitions for the SQL Query for Windows Search so I can simply work out what I can search on and what I can get back in my result set. I have not managed to find this anywhere.

Can anyone point me in the right direction?

Liaison answered 20/9, 2010 at 10:20 Comment(0)
L
6

OK. I have finally found all of the elements I might need. They are located here:

http://msdn.microsoft.com/sv-se/library/ff518152(v=VS.85).aspx

Almost too many to mention

Liaison answered 20/9, 2010 at 13:13 Comment(0)
C
5

This page (http://msdn.microsoft.com/sv-se/library/ff518152(v=VS.85).aspx) is a great starting point, but note that not all of the columns are valid in a Windows Search context (I presume they differ for other apps such as Windows Media Center. Through trial and error I have found that the valid columns on Windows 8.1 Search are:

- System.Comment
- System.Company
- System.ComputerName
- System.ContentStatus
- System.ContentType
- System.Copyright
- System.DateAccessed
- System.DateAcquired
- System.DateArchived
- System.DateCompleted
- System.DateCreated
- System.DateImported
- System.DateModified
- System.DueDate
- System.EndDate
- System.FileAttributes
- System.FileDescription
- System.FileExtension
- System.FileFRN
- System.FileName
- System.FileOwner
- System.FlagColor
- System.FlagColorText
- System.FlagStatus
- System.FlagStatusText
- System.Identity
- System.Importance
- System.ImportanceText
- System.IsAttachment
- System.IsDeleted
- System.IsEncrypted
- System.IsFlagged
- System.IsFlaggedComplete
- System.IsIncomplete
- System.IsRead
- System.ItemAuthors
- System.ItemDate
- System.ItemFolderNameDisplay
- System.ItemFolderNameDisplay
- System.ItemFolderPathDisplay
- System.ItemFolderPathDisplayNarrow
- System.ItemName
- System.ItemNameDisplay
- System.ItemNamePrefix
- System.ItemParticipants
- System.ItemPathDisplay
- System.ItemPathDisplayNarrow
- System.ItemType
- System.ItemTypeText
- System.ItemUrl
- System.Keywords
- System.Kind
- System.KindText
- System.Language
- System.MileageInformation
- System.MIMEType
- System.Null
- System.OriginalFileName
- System.ParentalRating
- System.ParentalRatingReason
- System.ParsingName
- System.Priority
- System.PriorityText
- System.Project
- System.ProviderItemID
- System.Rating
- System.RatingText
- System.Sensitivity
- System.SensitivityText
- System.SFGAOFlags
- System.Shell.OmitFromView

Also these Search-specific fields from this page (http://msdn.microsoft.com/en-us/library/windows/desktop/ff521715(v=vs.85).aspx):

- System.Search.AutoSummary
- System.Search.ContainerHash
- System.Search.Contents
- System.Search.EntryID
- System.Search.GatherTime
- System.Search.HitCount
- System.Search.Rank
- System.Search.Store
Comanche answered 15/8, 2014 at 22:27 Comment(1)
There is also this overview of available columns.Celtic
S
0

Querying the Index Programmatically is the landing page from where you can find relevant info. Microsoft Windows Search 3.x SDK has sample applications in C#/.NET/Visual Studio

Stagger answered 20/9, 2010 at 10:35 Comment(1)
Hi Khurram Thanks for that. I have found these pages already but I still can't find a breakdown of what the fields are that I can actually query on and get returned from my SQL statement. I can find the syntax of the SQL I can use which is fine as it is standard SQL but not the allow "table" definition for lack of a better description for what I am actually querying against. Any ideas?Liaison

© 2022 - 2024 — McMap. All rights reserved.