Thanks for the fast answer. Naively I imagined that in uploader I would hook up to the File/WasSaved event and via an ElasticSearch ingester I would put the pdf content into the search index. But being new to Flarum I don't see where I would get the info of where the search would have to point to. Where in Flarum would be the right place to do so?
Blomstra Search, an elasticsearch fulltext search extension
avandorp Flarum has Search Sources in js. This source would then be added to search, in addition this search source then would need an endpoint that queries elastic for related resources.
Ref:
- DiscussionSearchSource: https://github.com/flarum/framework/blob/main/framework/core/js/src/forum/components/DiscussionsSearchSource.tsx
- DiscussionSearch endpoint: https://github.com/flarum/framework/blob/main/framework/core/src/Api/Controller/ListDiscussionsController.php
Also look at how I extended DiscussionSearch endpoint: https://github.com/blomstra/flarum-ext-search/blob/main/src/Api/Controllers/SearchController.php
Here we are replacing the old search source, you can mimic this by just adding your own files source: https://github.com/blomstra/flarum-ext-search/blob/aabba9c2d0ff90a15be9ddcd1cc257a497d45607/js/src/forum/index.ts#L16
does it work in Chinese forum?
You can try to search for Chinese words, visit this link, copy the "测试中文搜索功能" to your forum, and see if you can only search for a single Chinese word, for example, "孔子" only searches for "孔", "曹操" searches for "" 曹" or "操", "blomstra/search" used to be able to search for phrases, but after the latest update, only a single word can be searched.
Hi there @luceos this looks like a really useful extension and I am somewhat familiar with setting up Elasticsearch so that's maybe a positive too. Thank you
We have a new Flarum setup we're really happy with, but we'd like to get search to return posts as results, rather than discussions—if it's just discussions, then it's hard to find the right post. Does Flarum built in search or does your Blomstra Search extension support listing search results as posts?
Do you mean "added" as in by forking and altering the code? I could maybe try to do that, I'm a software contractor although PHP is not my thing.
The reason I ask is that the leading complaint on my newly migrated bulletin board (used to be MyBB) is that when you search for a keyword with the out of the box feature, you can't get a list of posts as the results.
Since we have a heap of 1,000+ post discussions with repeated keywords, this is a bit of a pain … being able to filter the results by discussion would be terrific too.
attentive being able to filter the results by discussion would be terrific too.
I think this has been discussed previously as an option for core. A more advanced search component would however be required as currently not even the gambits are visible to users (user:luceos search
for instance), a component that will allow searching within discussions would therefor be needed for this change.
attentive not exactly what you're asking for but this might be useful: https://discuss.flarum.org/d/32017-post-stream-search
Thank you for your responses @matteocontrini and @luceos … yeah I reckon this area will have to see attention longer term for Flarum, I don't think the core search feature is quite good enough currently. We are all loving the platform however (we're using it on our tight-knit, long-lived Arsenal forum that's been going since 2006 or so on an old PHP stack).
I am a bit tied up with my day job at the moment, and perhaps will never have time to work on this, but it seems like something that should be doable with the right combination of Elastic indexers, search criteria, etc.
Hi,
I using this extension for a 500k messages board. I have indexed all my content with ./flarum blomstra:search:index --recreate
, since the rebuild with index creation I have no error in my logs... But I haven't any search result so. My Elastic is open on localhost:9200 and the communication between Flarum and Elastic seem OK. Is there a way to debug index / query ?
Hum... After running ./flarum queue:work
it seem OK... I must start this like a service ?
Other issue.
When I search and display all search results and filter on tag, response is empty. I need to refresh page to display the result. You can try this here: https://forums.fedora-fr.org/t/a-propos-de-fedora-fr?q=badge
- Edited
Another issue, with Syndication...
Is it a Syndication issue or a Bloomstra Search issue ? Is there a way to qucikly disable Bloomstra Search for a route ?
llaumgui Do you have a tracker ? Just for information, if I disable the extension all is OK (but slow).
https://github.com/blomstra/flarum-ext-search I think, but it being reported here is sufficient. Just need some time to look into it.
llaumgui it depends on their implementation, but it can definitely be a search issue. We override the default endpoint so that Elastic can be fully utilized during querying.