AppContentIndexer 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.
Important
App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID com.microsoft.windows.ai.appcontentindexer.
Creates, opens, and queries an index of your app's content. The index supports semantic and lexical search.
public ref class AppContentIndexer sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.Search.AppContentIndex.AppContentIndexContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppContentIndexer final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.Search.AppContentIndex.AppContentIndexContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Experimental]
class AppContentIndexer final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.Search.AppContentIndex.AppContentIndexContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppContentIndexer : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.Search.AppContentIndex.AppContentIndexContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Experimental]
public sealed class AppContentIndexer : System.IDisposable
Public NotInheritable Class AppContentIndexer
Implements IDisposable
- Inheritance
- Attributes
- Implements
Remarks
Use AppContentIndexer to create a searchable index of the content in your app, add text and image content to it, and then query it. For a walkthrough, see Get Started with App Content Search.
- Apps that use AppContentIndexer must have package identity. To enable semantic indexing and text recognition (OCR), the app must also declare the
systemaimodelscapability. - An AppContentIndexer instance isn't associated with a particular thread; it is an agile object. Some methods can take considerable time, so call them from a background thread rather than the UI thread.
- AppContentIndexer implements the IClosable interface (projected as IDisposable in C#). Close the indexer when you no longer need it so that it can release its underlying resources. If you open the same index more than once, close each instance. Opening and closing an index is expensive, so avoid doing it for every operation.
- The index contains only the content that you add to it. If the source of that content (for example, a file) changes, your app must update the index.
Properties
| Name | Description |
|---|---|
| DefaultLanguage |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| IndexName |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| Listener |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
Methods
| Name | Description |
|---|---|
| AddOrUpdate(IndexableAppContent) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| BatchAddOrUpdate(IIterable<IndexableAppContent>) | |
| Close() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| CreateImageQuery(String, ImageQueryOptions) |
Creates a query that searches the indexed images for content that matches the specified text query phrase. |
| CreateImageQuery(String) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID Creates a query that searches the indexed images for content that matches the specified text query phrase. |
| CreateImageQuerySession() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| CreateTextQuery(String, TextQueryOptions) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID Creates a query that searches the indexed text for content that matches the specified query phrase. |
| CreateTextQuery(String) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID Creates a query that searches the indexed text for content that matches the specified query phrase. |
| CreateTextQuerySession() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| DeleteIndex(String, DeleteIndexWhileInUseBehavior) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| GetContentItems() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetContentItems(QueryContentItemsFilterFlags) | |
| GetContentItemsRequiringReindexing() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetContentItemStatus(String) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetContentItemStatuses(IIterable<String>) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetContentStaticBoost(String) | |
| GetExistingIndexes() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetIndexCapabilities() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetIndexCapabilitiesOfCurrentSystem() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetIndexStatistics() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| GetOrCreateIndex(String, GetOrCreateIndexOptions) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID Opens the index with the specified name, or creates it if it does not exist, using the specified options. |
| GetOrCreateIndex(String) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID Opens the index with the specified name, or creates it if it does not exist. |
| GetRegionStaticBoost(String, String) | |
| IsContentKindSupported(RegionContentKind) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| RemoveAllContentItems() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| RemoveContentItem(String) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| RemoveContentItems(IIterable<String>) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| ResetAllStaticBoosts() | |
| SetContentStaticBoost(String, Single) | |
| SetRegionStaticBoost(String, String, Single) | |
| WaitForIndexCapabilitiesAsync() |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |
| WaitForIndexingIdleAsync(TimeSpan) |
Important App Content Search is a Limited Access Feature. Before you ship an app that uses APIs in this namespace, request a token for feature ID |