Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search function broken? #264

Closed
estaub opened this issue Apr 9, 2017 · 8 comments
Closed

Search function broken? #264

estaub opened this issue Apr 9, 2017 · 8 comments

Comments

@estaub
Copy link
Contributor

estaub commented Apr 9, 2017

If I try to search the doc online, using the search in the upper left corner, it fails with stack trace:

Uncaught TypeError: Cannot read property 'tf' of undefined
    at t.Index.documentVector (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:8688)
    at t.Index.<anonymous> (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:8449)
    at Array.map (native)
    at t.SortedSet.map (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:4292)
    at t.Index.search (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/lunr.min.js:7:8396)
    at LunrSearchEngine.search (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-lunr/search-lunr.js:34:40)
    at Object.query (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search-engine.js:31:23)
    at launchSearch (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search.js:79:33)
    at handleUpdate (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search.js:121:17)
    at HTMLInputElement.<anonymous> (https://basarat.gitbooks.io/typescript/content/gitbook/gitbook-plugin-search/search.js:142:13)
t.Index.documentVector @ lunr.min.js:7
(anonymous) @ lunr.min.js:7
t.SortedSet.map @ lunr.min.js:7
t.Index.search @ lunr.min.js:7
LunrSearchEngine.search @ search-lunr.js:34
query @ search-engine.js:31
launchSearch @ search.js:79
handleUpdate @ search.js:121
(anonymous) @ search.js:142
dispatch @ gitbook.js:2
m.handle @ gitbook.js:2
@basarat
Copy link
Owner

basarat commented Apr 12, 2017

@estaub estaub closed this as completed Apr 12, 2017
@basarat
Copy link
Owner

basarat commented Apr 13, 2017

Thanks. But leaving open till its fixed by gitbook 🌹

@basarat basarat reopened this Apr 13, 2017
@dylanscott
Copy link

I'm still experiencing this issue on the deployed version of the site - same error in the console

@estaub
Copy link
Contributor Author

estaub commented Jul 29, 2017

Still broken. A weak, perhaps obvious workaround is to google for

site:https://basarat.gitbooks.io <your-search-terms>

and then search within the page using your browser "find".

@estaub
Copy link
Contributor Author

estaub commented Jul 29, 2017

I tried without success to find an issue on https://github.com/GitbookIO/plugin-search, https://github.com/GitbookIO/plugin-lunr, or https://github.com/GitbookIO/gitbook that relates to this. @basarat, Are you sure this isn't a book-specific problem? Might it make sense to submit an issue (probably on https://github.com/GitbookIO/plugin-lunr)?

(I know nothing about GitBook, beyond what I dug up for this comment.)

@basarat
Copy link
Owner

basarat commented Jul 31, 2017

I've made my config https://github.com/basarat/typescript-book/blob/master/book.json same as mobx https://github.com/mobxjs/mobx/blob/gh-pages/docs/book.json But its still not working :( So definitely not an issue with with our config

@Pitasi
Copy link

Pitasi commented Sep 10, 2017

Adding this to book.json fixed the problem.
I think it was happening because of some emojis I used in my book.

{
    "pluginsConfig": {
        "lunr": {
            "ignoreSpecialCharacters": true
        }
    }
}

I also reported this here: GitbookIO/plugin-lunr#3

basarat added a commit that referenced this issue Sep 11, 2017
@basarat
Copy link
Owner

basarat commented Sep 11, 2017

@Pitasi that fixed it. Thank you soo much! 🌹

@basarat basarat closed this as completed Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants