diff --git a/examples/components/DocSearch.jsx b/examples/components/DocSearch.jsx index e9016929..a3026986 100644 --- a/examples/components/DocSearch.jsx +++ b/examples/components/DocSearch.jsx @@ -27,6 +27,7 @@ export default class DocSearch extends React.Component { } onSearch(query) { + query = query.toLowerCase(); if (query === '') { this.setState({searchResults: []}); return; @@ -43,7 +44,13 @@ export default class DocSearch extends React.Component { .substring(Math.max(0, index - 20), index + 60) .replace(query, `${query}`) }); - } else if (doc.title.indexOf(query) !== -1) { + } else if (doc.title.toLowerCase().indexOf(query) !== -1) { + results.push({ + title: doc.title, + path: doc.path, + abstract: '' + }); + } else if (doc.path.toLowerCase().indexOf(query) !== -1) { results.push({ title: doc.title, path: doc.path,