Windows Search using OLE DB SQL Fields

做~自己de王妃 提交于 2020-07-05 03:19:49

问题


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?


回答1:


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




回答2:


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



回答3:


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



来源:https://stackoverflow.com/questions/3750479/windows-search-using-ole-db-sql-fields

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!