Kikobeats / uno-urban

Simple and Elegant personal theme for Ghost.
https://kikobeats.github.io/uno-urban
8 stars 0 forks source link

Search Bar doesn't work #18

Closed jdchandler closed 7 years ago

jdchandler commented 7 years ago

found steps

jdchandler commented 7 years ago

followed the steps and if i type and search, the new page comes up but always 0 results

not sure what was wrong in steps

there are also images missing

Kikobeats commented 7 years ago

Need you index by algolia, right?

jdchandler commented 7 years ago

I followed the instructions from your guide in regards to the Algolia integration and it does not work.

Kikobeats commented 7 years ago

but console, any log? are you run the workers? what it says?

jdchandler commented 7 years ago

HI Kiko,

I literally followed the steps listed here: https://kikobeats.github.io/uno-urban/customization/search-engine/index.html

This does have broken picture embeds which wasn't helpful and maybe I missed a step.

I followed every step here and it just doesn't work.

I have ghost running as a service currently.

Where are the related logs that you need located?

juanlusdev commented 7 years ago

Hello Kiko,

First of all amazing theme, I loved it, but I have the same problem when I execute "gulp build-search" apparently the process can't obtain info from the posts, this is the error:

Error! Cannot read property 'category' of undefined Error! Cannot read property 'category' of undefined Error! Cannot read property 'category' of undefined Error! Cannot read property 'category' of undefined Error! Cannot read property 'category' of undefined

I don't know if I have to config posts with specific info for that the crawler works fine. I have located the lines in "search.json" with the problem but I don´t know how to make it work:

"selectors": { "category": "meta[property=\"article:tag\"]", "createdAt": "meta[property=\"article:published_time\"]", "description": "meta[property=\"og:description\"]", "image": "meta[property=\"og:image\"]", "prettydate": "time[datetime]", "title": "title", "updatedAt": "meta[property=\"article:modified_time\"]" }

Kikobeats commented 7 years ago

@jlgarciaap can you provide me your sitemaps urls? Looks like you don't have posts yet.

I reindexed my blog today for be ensure workflow and documentation is working and all works fine

juanlusdev commented 7 years ago

@Kikobeats I have 5 posts at the moment, the problem seems only to extract the information of the posts for Algolia

https://jlgarcia.fulldev.ninja/sitemap-pages.xml https://jlgarcia.fulldev.ninja/sitemap-posts.xml

Kikobeats commented 7 years ago

@jlgarciaap could be possible that your selector are wrong? need to scape quotes.

Try with these:

"selectors": {
    "category": "meta[property=\"article:tag\"]",
    "createdAt": "meta[property=\"article:published_time\"]",
    "description": "meta[property=\"og:description\"]",
    "image": "meta[property=\"og:image\"]",
    "prettydate": "time[datetime]",
    "title": "title",
    "updatedAt": "meta[property=\"article:modified_time\"]"
  },
juanlusdev commented 7 years ago

@Kikobeats sorry I have scape quotes, in my previous comment copy the information as text and the \ disappeared. Is it possible that the environment(production or develop) affects?

Kikobeats commented 7 years ago

I setup your sitemaps in my search.json and I indexed your posts 😂

❯ gulp build-search
[11:08:00] Requiring external module coffee-script/register
[11:08:03] Using gulpfile ~/Projects/sailorjs.org/kikobeats.com/content/themes/uno-urban/gulpfile.coffee
[11:08:03] Starting 'build-search'...
[11:08:03] Finished 'build-search' after 3.98 ms
Welcome to "KIKOBLOG" algolia-webcrawler v1.0.2

Configuring your index kikoblog
Parsing Sitemap https://jlgarcia.fulldev.ninja/sitemap-pages.xml
Registered http://jlgarcia.fulldev.ninja/
Sitemap https://jlgarcia.fulldev.ninja/sitemap-pages.xml registered 1 / 1 urls
Configured index properly

Parsing Sitemap https://jlgarcia.fulldev.ninja/sitemap-posts.xml
Registered http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-1/
Registered http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-3/
Registered http://jlgarcia.fulldev.ninja/gitlab-merges-migrar-gitlab-de-version-de-servidor-y-de-so/
Registered http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-2/
Sitemap https://jlgarcia.fulldev.ninja/sitemap-posts.xml registered 4 / 4 urls
Object gY/WuTSmR+taznuofrVBt7kkx70=:undefined saved (http://jlgarcia.fulldev.ninja/)
Object tcTAR5e5u2r3353p3JhjnW3g9LE=:undefined saved (http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-2/)
Object HRthFPpkxLfCvg1W3HtNxsmWeis=:undefined saved (http://jlgarcia.fulldev.ninja/gitlab-merges-migrar-gitlab-de-version-de-servidor-y-de-so/)
Object /O/g1MmL/QsuwU7eaFY0NvxP2Cw=:undefined saved (http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-3/)
Object xIPKf6Bk4PHeyJa0uBzMhzOYVU8=:undefined saved (http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-1/)

Removing old entries...
Deleting old entries done.

Try with that: https://gist.github.com/Kikobeats/e7bfb28e1390f2cc893ed1a758a5cbb3

Replace APPNAME, APPID, APIKEY and INDEXNAME.

juanlusdev commented 7 years ago

😂 Sorry, in my server I have this result:

[09:26:44]Requiring external module coffee-script/register
[09:26:46] Using gulpfile /var/lib/ghost/themes/uno-urban-3.3.7/gulpfile.coffee
[09:26:46] Starting 'build-search'...
[09:26:46] Finished 'build-search' after 8.96 ms
Welcome to "jlgarciaAPP" algolia-webcrawler v1.1.0

Configuring your index jlgarcia
Parsing Sitemap https://jlgarcia.fulldev.ninja/sitemap-pages.xml
Registered http://jlgarcia.fulldev.ninja/
Sitemap https://jlgarcia.fulldev.ninja/sitemap-pages.xml registered 1 / 1 urls
Parsing Sitemap https://jlgarcia.fulldev.ninja/sitemap-posts.xml
Registered http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-1/
Registered http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-3/
Registered http://jlgarcia.fulldev.ninja/gitlab-merges-migrar-gitlab-de-version-de-servidor-y-de-so/
Registered http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-2/
Sitemap https://jlgarcia.fulldev.ninja/sitemap-posts.xml registered 4 / 4 urls
Configured index properly

Error! Cannot read property 'category' of undefined
Error! Cannot read property 'category' of undefined
Error! Cannot read property 'category' of undefined
Error! Cannot read property 'category' of undefined
Error! Cannot read property 'category' of undefined

Removing old entries...
Deleting old entries done.
Kikobeats commented 7 years ago

totally lol. Try to fetch the HTML:

curl http://jlgarcia.fulldev.ninja/pensando-en-angularjs-parte-1/

and search the category tag

Kikobeats commented 7 years ago

@jlgarciaap what version of Ghost are you running?

juanlusdev commented 7 years ago

The category tag is present but the result is "indefined", I'm going to test with the algolia webcrawler code, for some reason not parse the posts correctly.

My Ghost version is 0.11.17

franklouwers commented 7 years ago

I have the exact same issue. Were you able to sort it out? Running 0.11.17 as well.

@Kikobeats your example lists algolia-webcrawler 1.0.2, both @jlgarciaap and myself have 1.1.0. Could that be the difference?

Kikobeats commented 7 years ago

@franklouwers could be possible. Can you force install my version?

npm install algolia-webcrawler@1.0.2

Then run again, and paste what happens

franklouwers commented 7 years ago

Yes, that did it! So it it must be something that has changed between 1.0.2 and 1.1.0

Kikobeats commented 7 years ago

@franklouwers thanks for the report!

I can block the dependency temporaly.

Ideally, we can open issue at https://github.com/DeuxHuitHuit/algolia-webcrawler/issues

juanlusdev commented 7 years ago

Thanks, It's working for me too

franklouwers commented 7 years ago

Confirmed issue in algolia-webcrawler https://github.com/DeuxHuitHuit/algolia-webcrawler/issues/20 . Workaround in https://github.com/DeuxHuitHuit/algolia-webcrawler/blob/master/config.json#L28-L39

Kikobeats commented 7 years ago

@franklouwers @jlgarciaap @jdchandler

A new version of algolia-webcrawler was released: https://github.com/DeuxHuitHuit/algolia-webcrawler/releases/tag/1.1.1

can you try with this new version?

franklouwers commented 7 years ago

Can confirm it works @Kikobeats

Kikobeats commented 7 years ago

good!

The package.json is locked to use the latest version, so no more additional action is needed.

Thanks for your quickly response and feedback guys ❤️