1

I am working on a old Windows 8 application which is using the ContentIndexer from Windows to build an index for a search engine in the app. It was working well until I updated my computer to the last Creators Update. I get an exception when I'm calling the AddAsync function :

var indexer = Windows.Storage.Search.ContentIndexer.GetIndexer();
await indexer.AddAsync(content);

The exception is : Exception from HRESULT: 0x80040DB4

The inner exception is null :(

For information, the exception is only raised when I am deploying my app on a computer with a Creators update. It's still working on Windows 8 and Windows 10 with previous updates.

I tried to create also a blank Windows 10 UWP app to see if the ContentIndexer is working but it failed too.

Do you any idea to fix this problem ?

Thanks

arya404
  • 346
  • 1
  • 8
  • 0x80040DB4 = GTHR_E_PIPE_NOT_CONNECTTED = The filtering process has been terminated. is the search indexer service running or stopped? – magicandre1981 Aug 24 '17 at 15:21
  • The service is running and I also tried to stop and restart it but nothing changed :( – arya404 Aug 25 '17 at 09:44

1 Answers1

0

For information, the exception is only raised when I am deploying my app on a computer with a Creators update. It's still working on Windows 8 and Windows 10 with previous updates.

The problem is the Stream property of content is not available. It is strange that if you don't set Stream and StreamContentType propety, it will work! I will report this issue to the related team. Currently one workaround to add content to indexer is that you could add index by using IndexableContent.

public async static Task<string> AddAppContentFilesToIndexedFolder()
{
    var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
    var installDirectory = Windows.ApplicationModel.Package.Current.InstalledLocation;
    var outputString = "Items added to the \"Indexed\" folder:";
    var appContentFolder = await installDirectory.GetFolderAsync("appcontent-ms");
    var indexedFolder = await localFolder.CreateFolderAsync("Indexed", Windows.Storage.CreationCollisionOption.OpenIfExists);
    var files = await appContentFolder.GetFilesAsync();
    foreach (var file in files)
    {
        outputString += "\n" + file.DisplayName + file.FileType;
        await file.CopyAsync(indexedFolder, file.Name, Windows.Storage.NameCollisionOption.ReplaceExisting);
    }
    return outputString;
}

For more you could refer to official code sample and select Add app content files to be indexed scenario.

Nico Zhu
  • 32,367
  • 2
  • 15
  • 36
  • Thank you for your answer but unfortunately I was already using IndexableContent in my application and in my Windows 10 UWP App. Besides, the code in this last one is already based on the ContentIndexer sample that you give in your answer. – arya404 Aug 25 '17 at 09:39
  • Yep, I have reported this issue to the related team, thank for your feedback! – Nico Zhu Aug 25 '17 at 15:23
  • @NicoZhu-MSFT do you have any feedbacks about the bug from the related team ? thanks – arya404 Oct 02 '17 at 12:52