ContentIndexer ContentIndexer ContentIndexer ContentIndexer ContentIndexer Class

Definition

Enables UWP apps to make private content searchable by using the system index.

public : sealed class ContentIndexer : IContentIndexer, IContentIndexerQueryOperations
struct winrt::Windows::Storage::Search::ContentIndexer : IContentIndexer, IContentIndexerQueryOperations
public sealed class ContentIndexer : IContentIndexer, IContentIndexerQueryOperations
Public NotInheritable Class ContentIndexer Implements IContentIndexer, IContentIndexerQueryOperations
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 Revision Revision Revision Revision

Gets the version of the ContentIndexer.

Methods

AddAsync(IIndexableContent) AddAsync(IIndexableContent) AddAsync(IIndexableContent) AddAsync(IIndexableContent) AddAsync(IIndexableContent)

Adds app-defined items with properties and content to the system index.

CreateQuery(String, IIterable<String>) CreateQuery(String, IIterable<String>) CreateQuery(String, IIterable<String>) CreateQuery(String, IIterable<String>) CreateQuery(String, IIterable<String>)

Builds a query with the specified search filter and identifies which properties to retrieve.

CreateQuery(String, IIterable<String>, IIterable<SortEntry>) CreateQuery(String, IIterable<String>, IIterable<SortEntry>) CreateQuery(String, IIterable<String>, IIterable<SortEntry>) CreateQuery(String, IIterable<String>, IIterable<SortEntry>) 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>, IIterable<SortEntry>, String) CreateQuery(String, IIterable<String>, IIterable<SortEntry>, String) CreateQuery(String, IIterable<String>, IIterable<SortEntry>, String) CreateQuery(String, IIterable<String>, IIterable<SortEntry>, String) 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.

DeleteAllAsync() DeleteAllAsync() DeleteAllAsync() DeleteAllAsync() DeleteAllAsync()

Removes all app-defined items from the ContentIndexer.

DeleteAsync(String) DeleteAsync(String) DeleteAsync(String) DeleteAsync(String) DeleteAsync(String)

Removes the specified app-defined item from the ContentIndexer.

DeleteMultipleAsync(IIterable<String>) DeleteMultipleAsync(IIterable<String>) DeleteMultipleAsync(IIterable<String>) DeleteMultipleAsync(IIterable<String>) DeleteMultipleAsync(IIterable<String>)

Removes the specified app-defined items from the ContentIndexer.

GetIndexer() GetIndexer() GetIndexer() GetIndexer() GetIndexer()

Gets an existing per-app index or creates a new one, if necessary.

GetIndexer(String) GetIndexer(String) GetIndexer(String) GetIndexer(String) GetIndexer(String)

Gets the per-app index with the specified name or creates a new one, if necessary.

RetrievePropertiesAsync(String, IIterable<String>) RetrievePropertiesAsync(String, IIterable<String>) RetrievePropertiesAsync(String, IIterable<String>) RetrievePropertiesAsync(String, IIterable<String>) RetrievePropertiesAsync(String, IIterable<String>)

Gets content properties based on the given content identifier.

UpdateAsync(IIndexableContent) UpdateAsync(IIndexableContent) UpdateAsync(IIndexableContent) UpdateAsync(IIndexableContent) UpdateAsync(IIndexableContent)

Updates app content and properties in the ContentIndexer.

See Also