Search for Ghost

Currently Ghost doesn’t have a search functionality, and search functionality is expected out of the box from most of the users. At least the ones I encounter. I use the GhostHunter plugin for my projects but it is not ideal as it only supports English.

Any ideas and solutions are welcome.

Best solution is generally Algolia, but it’s a bit manual and experimental atm:

3 Likes

Thank you, @John, I will have a look.

Another great integration for Ghost search would be Apache Solr, very powerful and open source. See e.g. Google chooses Solr for Public Service Website Search.

As a code example at GitHub, see the Solr integration for the NodeBB next-generation forums, wich are based on Node.js like Ghost.

There is also [Discussion] Solving Search in Ghost? · Issue #5321 · TryGhost/Ghost.

What do you mean?
I use Ghosthunter, my blog is Italian, I have no problem, i really like it.

I noticed, however, that algolia generates a string in the url, example /?q=&idx=blog&p=0

I would like to have something with ghosthunter, but I can not understand how.
I remember that once it worked the same way.

EDIT: Algolia is not free? So bad

@giacomosilli:
I think what @asta meant was that GhostHunter can only search for words with the “Latin” format (ex: English, French, Italian etc.) but for the moment it doesn’t work with words with the “Arabic” or “Asian” format for example.

Personally I have tried with Sino-Japanese characters and it’s not able to perform the search.

2 Likes

On the other hand, Solr search (open source, mentioned above) supports a large number of languages, including Chinese, Japanese, Arabic, etc. Of course developing a Ghost-Solr integration would be also great for those international use cases.

2 Likes

Didn’t realise search wasn’t built into Ghost until recently.
Quite surprising considering how the other parts worked beautifully but there’s no basic functionality like a search till now.
Guess I have to try GhostHunter for now.
Hope search makes it into the top feature list.

I think part of the reason certain features don’t exist is there’s not enough expertise / an upstream requirement (for example, the original issue links to this upstream issue for the specific feature, coupled with the fact the core team is meticulous in implementing features that work well. Ghost is still quite young, so it will take time for it to have a lot of features. Also, from what I can tell, there’s a lot of thought in deciding what order to implement something, and there are lots of things to think about, like the tradeoff between adding features and maintaining performance

2 Likes

I am quite suprised that Ghost does not have a search button. It has an amazing subscribe process which is easy, but from the get-go, Ghost is supposed to make it easier to get blogging, yet many of the basic or necessary features one would expect on a blog is not there and needs to be added manually. I think most bloggers are not devs and thus Ghost does not make it easy to get the basic features going.

I would love a search function built in.

3 Likes

yes, it’s a minor inconvenience, but I think this plugin is pretty easy to add:

despite that, built in search is something that most CMS’s ‘forget’ to build in.
I’m still unsure how is this not a feature that every blog needs by default; aka
what’s the reasoning to go without it.

It’s nice to see it’s planned

1 Like

I agree. Thanks for the tip, will check it out.

The issue that I have is this: I have a team of young students who wants to help me start blogging and writing for students and teenagers. I am the only one that can get something installed and set up but I am by no means a developer. So struggled to get Ghost up and running, now that it is done, great stuff! But then someone asked me: how do people search for specific questions etc that we will cover one a blog page just full of posts and I was like “oh yeah good question”.

I know Ghost has come a long way, but if they want more users to switch over to Ghost and focus more on writing…it seems you spend more time trying to get everything up and going and developing that writing.

Yes Ghost Pro solves many of that, but Ghost Pro does not have search either and it is expensive.

So I am glad to see it is planned, but would have thought it is a core feature from earlier on.

2 Likes

ElasticSearch support would be dope in the future.

1 Like

just an idea.

use sqlite3 as database for your ghost.
then there will be a database file.
open the database file via sqlite3.

$sqlite3 content/data/ghost-dev.db
SQLite version 3.11.0 2016-02-15 17:29:24
Enter “.help” for usage hints.
sqlite> .tables
accesstokens migrations refreshtokens
api_keys migrations_lock roles
app_fields mobiledoc_revisions roles_users
app_settings permissions sessions
apps permissions_apps settings
brute permissions_roles subscribers
client_trusted_domains permissions_users tags
clients posts users
integrations posts_authors webhooks
invites posts_tags

As you can see, all posts definitely stored in the table named ‘posts’.

sqlite> select * from posts;
id|uuid|title|slug|mobiledoc|html|comment_id|plaintext|feature_image|featured|page|status|locale|visibility|meta_title|meta_description|author_id|created_at|created_by|updated_at|updated_by|published_at|published_by|custom_excerpt|codeinjection_head|codeinjection_foot|og_image|og_title|og_description|twitter_image|twitter_title|twitter_description|custom_template

Then we got the structure of the ‘posts’ table.
As I tested, ‘slug’ is the route path of a recorded post.

let’s search posts contains ‘welcome’ as an example.
sqlite> select slug from posts where html like ‘%welcome%’;
slug
apps-integrations
welcome

then we can check the real post in browser.
http://localhost:2368/welcome
http://localhost:2368/apps-integrations

see, search things goes well in a shell bash.
all we need to do write js codes to do above operations and display the result correctly in ghost core server module.

anyone who familiar with ghost developing work can have a try for that.
any suggestion please guide.
I would like to implement it at part time.
Hope I can finish it soon.

1 Like

i just realised that the Ghost already has the search built in into the admin console, why not just enable that feature in the main theme too.

image

6 Likes

Yes. I too agree. Basic post search should be provided by Ghost natively. Many themes from Ghost Marketplace like Voice support search functionality but nothing beats native support. I guess with Ghost Content API now public, providing a basic search functionality shouldn’t be a hard task for the people at GHOST. Please guys, we need it!

1 Like

Hi folks, I’m currently considering migrating from WP to Ghost, I publish a long running blog with 60,000+ articles and our readers use search a lot to discover our back catalogue. Is Algolia still experimental/unreliable?

docs.ghost.org is powered by Algolia so I assume it’s reliable to use.

1 Like

Hello,
I also use Algolia, and I feel really good, this is the address if you want to see it

Warning I use adsense NOT profiled.

4 Likes

Can you provide more info on how you integrated Algolia search with Ghost?

There is a way here, but it seems outdated:

I checked https://docs.ghost.org/integrations/, but I saw no integration (maybe Ghost team can help with this?).

2 Likes