I installed it, imported the posts into the index and the search even works great, matching partial search terms...
However I am getting 500 while browsing the forum
I installed it, imported the posts into the index and the search even works great, matching partial search terms...
However I am getting 500 while browsing the forum
OK, I got it, in the Flarum logs there's Algolia message saying I exceeded the quota (10k objects and we have 11k posts )... So, I upgraded to the $1 a unit tier, let's see how much it will cost, my understanding is $1 for each additional 1000 objects.
Seems to be working well so far, thanks a lot! Much better than the embedded SQL search.
I see some odd situations though. For instance I created a post where I have a sentence containing "Chinese manufactured". If I search for "Chinese", I get results from other discussions and posts but not this one. If I search for "Chinese manufactured", then it's found. A bit odd, why would that happen?
GreXXL it seems to be an issue caused by the use of a database table prefix. I'll look into this right away.
CyberGene If I search for "Chinese", I get results from other discussions and posts but not this one
Yep, that's odd. I haven't tested Algolia yet so not sure what's happening. I'll try replicating with Meilisearch this afternoon and see if it gives me any clue.
I'll need to do a proper and complete Algolia test at some point but haven't had the time yet.
CyberGene I exceeded the quota
Yep, every post (including first post of discussions), every discussion and every user will most likely count as one object. There's currently no way to exclude a specific resource but I could imagine adding an option to exclude users from Scout if this helps reduce service cost and isn't absolutely needed.
I recommend running the scout:import-all
command to fix all existing broken records.
This update changes the way post content is indexed. Previously the markdown/bbcode version of the post from edit mode would be sent to the index. Now it's the rendered HTML version except it's stripped of any HTML. This should prevent hidden information from being leaked via search (example: old username if a mentioned user changed their username, content hidden with the hide bbcode/reply/likes extensions). But it also means image and link URLs are now no longer indexed. I will try to add an option to get those URLs indexed again in a next version.
CyberGene I was not able to replicate your issue on Meilisearch, however I found out the synchronization wasn't working correctly. So maybe your new post wasn't indexed yet.
If the problem happens again, can you try performing the search directly in Algolia's dashboard? To see if any result exists in the search index? Meilisearch has a nice built-in web interface that allows inspecting the current state of the index and I believe Algolia has something similar.
They got opensource version too I will try this
https://docs.meilisearch.com/learn/cookbooks/digitalocean_droplet.html
CyberGene Algolia is expensive, go through this old discussion luceos
clarkwinkelmann thanks, I installed the update and reimported the index. Seems like the search issue I had is fixed now, so maybe the problem was with what you described as possible reason. I will let you know if there are some other issues. So far all looks pretty good, thanks a lot!
Hari Thanks, I may check that later after I see how much Algolia will cost me this month.
Hari what's this digital ocean service, is it verified? I'm trying to register myself and can't go through the initial payment validation. I tried every possible payment method: Apple Pay, PayPal, direct credit card with all my cards and nothing goes through, they are all rejected for some reason. I'm giving up...
Never mind, registered with Revolut, maybe my bank is having some problems currently.
clarkwinkelmann If you are regularly running composer update on all your dependencies, you should add an explicit requirement for the Meilisearch SDK in your composer.json because the extension requires * which might jump to a newer Meilisearch SDK version as soon as it comes out.
Can you tell me what exact stuff should I put in the composer.json?
I switched to Meilisearch in DigitalOcean, as explained by the link Hari posted. I imported the indexes, all works. I guess I will use it instead of Algolia because it's cheaper. Thanks Hari
Hello, I use the extension with meili search and it works well, thank you!
However I find that the results that match content is prior to those match title. How shall I change the priority?
Thank you!
tohsakarat unfortunately it's a consequence of the current implementation, so can't be changed.
I'm not sure what the best way to calculate the sort order is. The problem is there are 2 indexes, one for discussion data (title) and one for post data (content). And I can't get the Meilisearch matching score out of Scout, only the order of the results. So merging the 2 in a way that makes sense is quite challenging. I guess it will require some specific code to go deeper level into Meilisearch API or modify the logic to use a single index.
Following a suggestion by @010101 I have added TNTSearch support to the extension.
Existing users don't need to install this update if they are not planning to try TNTSearch.
To update:
composer require clarkwinkelmann/flarum-ext-scout
Additionally, to use TNTSearch you need to install an additional package. This package requires the sqlite PHP extension on the server!
composer require teamtnt/laravel-scout-tntsearch-driver
See the README on GitHub for more information https://github.com/clarkwinkelmann/flarum-ext-scout#tntsearch
If you switch driver, you need to rebuild the indexes with the command!
From my tests, TNTSearch seems an incredibly poor search engine. Their documentation is very lacking and the few options/syntaxes that are described don't seem to work. Maybe it can be improved slightly by playing with the settings, but I'm not sure it brings much improvement over Flarum native search.
This extension is still very experimental and designed to test alternate search engines with the goal of maybe integrating some of them natively in Flarum in the future.
clarkwinkelmann Why you prefered the TNT instead of Meilisearch?
fakruzaruret I'm not sure what you mean.
The 3 drivers I've tested so far are Flarum native search, Meilisearch and TNTSearch. I have still not tested Algolia myself despite the extension supporting it.
I didn't see much of a difference between Flarum native and TNTSearch. I tried TNTSearch negative keyword syntax and tried searching sentences but it doesn't seem to work. It just works with simple keywords, much like Flarum native search.
Meilisearch is still my favorite solution so far, it works great and is incredible at searching for partial words and wrong spellings. I have not had an opportunity to use it in production yet, but I'm hoping to install it on one of my forums later this year.
I've been using Meilisearch through this extension for some time now and I'm very happy with it. The only thing is I have to pay €7 a month for the DigitalOcean droplet and while that's not much, I'm still not sure if it's worth it over the Flarum native search. I'll have to check with my users about how often they use the search functionality but it seems they don't care a lot and don't use it too much, so I may switch to Flarum native again unless I find cheaper Meilisearch solution since my current needs are just too tiny to justify even €7 a month.
CyberGene where are you hosting your forum? You might be able to place Flarum and Meilisearch on the same server to save on cost.
Meilisearch seem to be working on a cloud hosting, but there's just a waitlist and no mention of the pricing. I doubt it would be affordable for this kind of use case but we never know.
It's true that if few people use the search bar, switching driver might not make a lot of sense. One place where people might not immediately realize is using the search are mentions. The auto-complete relies on the same user search endpoint. But user search is also not dramatically improved over the native search since it's just usernames that are indexed anyway.
clarkwinkelmann I’m hosting my Flarum on Siteground. I could use another hosting where I have more choice about the cloud services but I will have to research it first. Siteground has been very reliable and fast, especially since I was on A2 before which was very unreliable.