Ghost-search: Our First Open Source Library for Ghost

#1

Hi guys,

A month ago I decided to work on something that everybody can benefit from. So I started an open source library called ghost-search. After some work I’m proud to announce that I finally have a version that can be used.

Why I started this library?
As you probably know, there is already a search library for Ghost: ghostHunter. The library is good, it does its job, but I always felt that you could do a lot more with a search. Especially now with Dynamic Routing. With ghost-search you can search through posts, tags, users, custom collections, use filters, specify which fields to retrieve and more.

Read more here if you want to know how to setup and customize ghost-search.

The library can be used with/without jQuery.
It’s using fuzzysort as a search algorithm.
Has only 13kb in production.

Let me know what you think.

If you have any questions or suggestions feel free to write in here.

22 Likes

Weblog — a seriously old-school ghost theme
Search for Ghost
Help with a bit of debugging on a Ghost blog that freezes
#2

Thank you @HauntedThemes for sharing it with the community. I would love to use it and contribute to the project. :+1:

1 Like

#3

Awesome! Thank you for sharing @HauntedThemes. How does ghost-search work with other languages?

1 Like

#4

I’ve tested with chinese, russian and an arabic language. I didn’t had a problem.

2 Likes

#5

Thank you @HauntedThemes :+1: :clap:

0 Likes

#6

Really thanks.
But does it support non-latin charactors like japanese or korean or chinese?
Right now ghosthunter only support japanese, please do better, thanks in advance.

0 Likes

#7

This is great! Thanks a lot! :tada:

0 Likes

#8

Hi, good work, it works well. Is it possible to obtain other information in the search result, such as the description and the img of the article as well as the title and the slug? Thank you

EDIT:
Great job boy.

I love this script.

I was able to filter also description and image, it is very simple.

This script is much faster than ghosthunter.

Thanks again

EDIT 2:

There is only one problem

The title of my article is for example: “how to install java”
Input: install java -> found 1
but
Input: java install -> found 0

is it possible to solve this problem?

0 Likes

#9

The library uses fuzzysort as an algorithm for searching. So you might want to take a look at it. In ghost-search library, modify the threshold value to something lower. Check default options to see how to set it. Try -10000 and see what you get.

0 Likes

#10

Thanks for the reply.
Apparently -3500 or -10000 or -100000 does not change anything

0 Likes

#11

Am I doing something wrong ?

0 Likes

#12

I looked at your docs. I’m very impressed!

0 Likes

#13

We’ve updated our open source search library to be compatible with Ghost’s Content API. Check it out:

5 Likes

#14

After a long search I finally found this ghost-search…
Thanks for the good job.

0 Likes

#15

i want to make production build but got error of ghost api key is invalid…
plz help me out as my project deadline is goin to end soon !!!

0 Likes