algolia / algoliasearch-jekyll

⚠ DEPRECATED Use jekyll-algolia instead.
https://community.algolia.com/jekyll-algolia/
MIT License
125 stars 12 forks source link

algolia selector returning undefined #48

Closed lingxz closed 7 years ago

lingxz commented 7 years ago

Hi, I'm using Algolia search for my blog, and for some reason the algolia selector is always returning undefined, and I can't seem to figure out why. The site is here and the source code is here. I'm using the js from jekyll-algolia-hyde with a slight modification. Thanks!

Haroenv commented 7 years ago

I think there’s a small mistake in the html for your input, I made a PR to your repository: https://github.com/lingxz/lingxz.github.io/pull/15

lingxz commented 7 years ago

thanks @Haroenv! but the issue still persists, apparently.

pixelastic commented 7 years ago

Hey @lingxz, could you give me a link to the file that contains the undefined selector? I have trouble finding the relevant one in your repo :)

lingxz commented 7 years ago

hi @pixelastic, the relevant algolia files are here and here, and the search box is here. The undefined selector appears when the search result is returned. For example, searching for something like "test" in the search box and clicking enter returns some links, and the links go something along the lines of https://theconfused.me/blog/drifter-writing-interactive-fiction-with-ink/#algolia:undefined

lingxz commented 7 years ago

Ah, it seems that when using v1, the css_selector property is not indexed properly. When using v1, the css_selector shows as null but when I revert back to using the released 0.8 version, all is working well.

pixelastic commented 7 years ago

If you're using the v1, the key is actually named record_css_selector there. Note that v1 is not (yet) officially released. You should be able to find all the relevant configuration options and documentation here.

I'm closing the issue as it seems to fix your issue. If not, feel free to comment and I'll re-open it.