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.


Search for Ghost
Weblog — a seriously old-school ghost theme
#2

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


#3

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


#4

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


#5

Thank you @HauntedThemes :+1: :clap:


#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.


#7

This is great! Thanks a lot! :tada:


#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?


#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.


#10

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


#11

Am I doing something wrong ?


#12

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