Docfx: Search Doesn't Work on Azure Websites

Created on 25 May 2017  路  2Comments  路  Source: dotnet/docfx

Search won't work on Azure Websites

I've compiled the seed project locally and ran it using docfx --serve and was able to successfully use the search function there. I took the contents of the _site folder and uploaded to Azure Websites and the search function doesn't return anything.

Functional impact

I'm unable to use the search function throughout the entire site.

Minimal repro steps

  1. Build the seed project with docfx build
  2. Upload the contents of the _site folder to Azure Websites via FTP.
  3. Attempt to search the website for any word or phrase. Let's use docfx as an example.

Live demo: http://docfxseed.azurewebsites.net

Expected result

I expected a page of results for the phrase docfx to show up.

Actual result

The search only displays the following message:

Search Results for "docfx"

Further technical details

The Azure Website I'm uploading the contents to doesn't have any extra configurations. I simply created a Web App, downloaded the FTP information, and uploaded the contents of the _site folder.

Most helpful comment

Cannot download https://docfxseed.azurewebsites.net/index.json, you need add web.config, see How to serve static .json files from a Windows Azure Website

xml <?xml version="1.0"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> </system.webServer> </configuration>

All 2 comments

Cannot download https://docfxseed.azurewebsites.net/index.json, you need add web.config, see How to serve static .json files from a Windows Azure Website

xml <?xml version="1.0"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> </system.webServer> </configuration>

Thanks, that solved my problem 馃槃

Was this page helpful?
0 / 5 - 0 ratings