Mkdocs: Search not working on Windows Server

Created on 12 Apr 2018  路  6Comments  路  Source: mkdocs/mkdocs

Hi, I stood up a new MKDOCs site and it looks great. The problem is search doesn't work.. I've looked at other issues here and it doesn't seem related but I am not sure?

I've tried a bunch of themes and the same result.

The query appears like this: https://python-iaa.azurewebsites.net/mkdocs/site/search.html?q=SCRIPT

I'm utilizing Azure App Service as Windows.

mkdocs - version 0.17.3
python - version 3.5.4

Most helpful comment

See this comment for a resolution to search not working on the IIS Windows server. I would not be surprised if an Azure Windows server has the same defaults.

All 6 comments

Does search work with the dev server? Try running mkdocs serve locally and testing search there. If that works, then the problem is likely related to your server config, which will require more information for us to help you.

As an aside, search has been completely rewritten and the new search will be available in the next release (1.0.0). It's not likely that any potential bug found here still exists in the current codebase.

Thanks, I will try that, I did not try dev.. I wanted to see if I can get it running in Azure App Services because that's the end goal. Are you saying mkdocs 1.0.0 will be coming out soon, jumping from 0.17.3? I will try a test later today.

So I tried locally and I can search. I tried with python 2.7.

When I setup python 2.7 in Azure App Services I can't search... weird :-/.

What kind of details would you need? I am running Azure App Services with Python extensions. I can definitely compile my markdown files and the site builds. But when I search it doesn't work.

My best guess is that the server is incorrectly reporting the content type for a certain file type or two and that should raise some errors in the browser. Does your browser's debug tools report any errors?

See this comment for a resolution to search not working on the IIS Windows server. I would not be surprised if an Azure Windows server has the same defaults.

This resolved it. I created a web.config file with this below and now search works.

<?xml version="1.0" encoding="UTF-8"?>
  <configuration>
    <system.webServer>
      <staticContent>
        <mimeMap fileExtension=".json" mimeType="application/json" />
        <mimeMap fileExtension=".mustache" mimeType="text/template" />
      </staticContent>
    </system.webServer>
  </configuration>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartinAyla picture MartinAyla  路  6Comments

oliviernguyenquoc picture oliviernguyenquoc  路  6Comments

KerimG picture KerimG  路  5Comments

juanpmarin picture juanpmarin  路  3Comments

adrwh picture adrwh  路  5Comments