ContentIndexer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enables UWP apps to make private content searchable by using the system index.
public ref class ContentIndexer sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ContentIndexer final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ContentIndexer
Public NotInheritable Class ContentIndexer
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
Content indexer sample (Windows 10)
Video Walkthrough of a demo app
Remarks
The ContentIndexer class enables apps to push a property bag into the system index which can later be searched quickily by the app or user. The property bag can contain any properties from the shell property system and is available to search instantly after the API call returns.
The properties are defined as string-object key-value pairs, where the keys are standard Windows property names, like System.Author, and the values are PropertyValue instances. The property must be registered on the system and have isColumn and isInvertedIndex set to true. You can also provide full-text search content by using a stream and content type. This corresponds to running the IFilter implementation for the type and indexing the content.
You can query over content by using Advanced Query Syntax (AQS).
Don't use the index as a primary data store, the index is only a cache of searchable properties. All data in the index must be stored elsewhere in case the cache is lost. Content is separated per app package and per user. A package can't query another package's data, but the operating system can access any data that is pushed in.
For more information on the properties available to use, see the Windows Property System.
Properties
Revision |
Gets the version of the ContentIndexer. |
Methods
AddAsync(IIndexableContent) |
Adds app-defined items with properties and content to the system index. |
CreateQuery(String, IIterable<String>, IIterable<SortEntry>, String) |
Builds a query with the specified search filter, sort order, filter language, and identifies which properties to retrieve. |
CreateQuery(String, IIterable<String>, IIterable<SortEntry>) |
Builds a query with the specified search filter, sort order, and identifies which properties to retrieve. |
CreateQuery(String, IIterable<String>) |
Builds a query with the specified search filter and identifies which properties to retrieve. |
DeleteAllAsync() |
Removes all app-defined items from the ContentIndexer. |
DeleteAsync(String) |
Removes the specified app-defined item from the ContentIndexer. |
DeleteMultipleAsync(IIterable<String>) |
Removes the specified app-defined items from the ContentIndexer. |
GetIndexer() |
Gets an existing per-app index or creates a new one, if necessary. |
GetIndexer(String) |
Gets the per-app index with the specified name or creates a new one, if necessary. |
RetrievePropertiesAsync(String, IIterable<String>) |
Gets content properties based on the given content identifier. |
UpdateAsync(IIndexableContent) |
Updates app content and properties in the ContentIndexer. |