Skip to main content


Search?


!Friendica Support

Hi! My first message ever to a forum, so hoping this will work.
I have set up my own Friendica instance, and loving it so far. One thing though: do I have to do/enable something to get the "search" working for anything that isn't usernames (which I do find)?

If I search on something that is not a fediverse username, it consistently finds absolutely nothing. I have gone through all the settings in admin to ensure it isn't only searching "users" or "tags".

If I compare searching between Friendica and Pleroma (which I also run an instance of, on another server) the Pleroma instance finds absolutely anything in the Fediverse. Users, tags, free text content etc. I would like that on Friendica too. Is it possible? Have I misconfigured something?

I run the latest develop branch on my (Ubuntu hosted on Digital Ocean) server.

Friendica Support reshared this.

There is a setting in admin > panel > site > performance > only search in tags – you need to disable that.
@Steffen K9 🐰 thanks. But yes, I already had checked to ensure it isn't set to that. I actually made sure that box wasn't ticked already at install, but have also verified it hasn't been ticked since.

I was also thinking I should "give it time" to announce itself on the fediverse or something, but now it has gone a couple of days. Everything works perfectly, except for the search.
Hello @Mathias Hellquist, there is a setting somewhere in /admin to disable search in completed text and instead it will only search tags and usernames.

However it will only find local content, so you need to have post to find anything. To receive more posts locally you have to setup a relay or some relais. I'd suggest some Mastodon (ActivitiPub) relais and the last remaining diaspora relay. This will get you lots of posts over time, then you'll find more with your searches.
@utzer thanks. Right, so how would I enable relays? I mean I have the default setting from the installation, which basically has Admin -> Site -> Message relay -> the box for "use message relays" is checked (as in "on").

In the field for relays there is a pre-populated value of https://social-relay.isurf.ca

Is that good/bad/wrong? Where do I find other/alternative relays?

I also notice "Direct relay transfer" is also "on" (checked).
"Relay scope" is set to "all".

If I compare to Pleroma search I can search on spurious/random words and it will find that word regardless of if it is in a username, a tag, a post etc. For example searching for "football" will return lots of content, none of which I have posted or interacted with (I'm not much of a football fan).
@Mathias Hellquist that relay is correct, the direct relay setting is good too.
Besides that there is AP relays, which you can currently just add by the bin/console, so you need to use the Linux CLI.
@Mathias Hellquist besides this, it might take a bit. The relays will take some time until you receive posts via them.

How many active users are on the pleroma server, alls the posts of people the follow or the posts they interact with, are stored locally on the server, so theses will be searched too I assume.
Same for Friendica, if you follow more people or interact with more posts you'll have more local posts to search through. Same for other users on your server.
This entry was edited (3 years ago)
@utzer both my Friendica and my Pleroma instances only have a single user: me. I follow just about as many people on both services. The Friendica instance is about 2 weeks younger than the Pleroma instance though.
@utzer I have complete root access to my server so can run whatever on the CLI. I need to know what to run though (I've learnt that improvising on things like these rarely ends well). :)

Are there any pointers/guides to "how-to" and what commands/values to use?
@Mathias Hellquist you need to find some relais first, then you can go to the Friendica base dir and run "bin/console help" best run the commands as the webserver user, not as root.
There might not be much documentation about the AP relay, but you can see on your Friendica server under /help if there is something.
@Michael Vogel thanks. Right, so how do I "enable" fulltext search?

In my log I have a bunch of entries that look like this, is it even related?

2021-02-06T07:44:23Z index [ERROR]: DB Error {"code":3065,"error":"Expression #1 of ORDER BY clause is not in SELECT list, references column 'friendica.post-view.received' which is not in SELECT list; this is incompatible with DISTINCT","callstack":"DBA::p, Profile::rawContent, call_user_func, Module::run, App::runFrontend","params":"SELECT DISTINCT(parent-uri-id) AS uri-id, created FROM post-view WHERE uid = 2 AND NOT contact-blocked AND NOT contact-pending AND visible AND (NOT deleted OR gravity = 3) AND NOT moderated AND wall AND received > '2021-02-06 02:41:14' AND private != 1 ORDER BY received DESC"} - {"file":"Database.php","line":662,"function":"p","uid":"76430f","process_id":648036}
@Michael Vogel ah right. I actually went a little bit lazy for the basic server setup and picked a bog-standard "LEMP" server from Digital Ocean, based on Ubuntu 20.04. Figured it'd be alright. I should possibly try to switch over to MariaDB then...?
@Michael Vogel hehe, true as well. I was actually just sitting and brushing up on my "backup/restore db" skills to see if it would be possible to install MariaDB next to MySQL and basically restore a backup of the structure/data from one to the other, without losing too much data in the process. Main reason would be to "not be annoying" and not trying to run "exceptions" as that will make it more difficult for me to ask for help.

Also, as I ended up running the development branch of Friendica it could make sense. Then again, as it is only me on my instance it isn't "critical" for anyone else, so could also do as you suggest, stick to MySQL and report errors as and when they happen.

I have no idea what the db error I do get (above) actually impacts though.
@Michael Vogel sweet jesus. I'm now back after having been offline pretty much 24h, hehe. I tried to swap from MySQL to MariaDB. Turns out they aren't actually compatible enough to do a backup->restore of tables and data.

This was then coupled with it being almost nigh on impossible to re-install MySQL after having uninstalled it, and installed/un-installed MariaDB. Apparently I'm not the only one, so luckily there were enough examples of how to fix it so I finally could re-install MySQL and get my instance back up again.

I won't be doing that any time soon again. So, I guess it is "stick to MySQL and file DB errors then" hehe. :)
@Mathias Hellquist@Michael Vogel
Turns out they aren't actually compatible enough to do a backup->restore of tables and data.

yes, they are not compatible anymore sind MySQL 8, neither compatible to MySQL 7.x nor to #MariaDB.
@utzer@Michael Vogel It is a shame though. Especially as when I set up my server MySQL, or "MySQL compatible, such as MariaDB" was the recommendation. This was the reason I figured "a standard LEMP server will do". I had no idea that it would mean "but search will absolutely not work then".

Might be worth updating documentation to highlight that.
For me, I'm not really sure how to go forward. Should I invest more time in the instance I have (building contacts etc) or should I scrap it and start over again? As I can't backup/restore the database and change from one to the other I am not looking forward to adding all contacts once again etc. Then again, "search" would be great to have. I can't right now for example use "saved searches" or follow tags etc, as they return exactly nothing.
@Michael Vogel

one question on that though: as I am "new" to Friendica I am currently not great (yet) at explaining what possibly go wrong. Sometimes I don't think too much about it. Yet I get a log entry.

My question becomes: Should I post the db error log entry to the issues even if I can't "explain" them? I'm thinking they quite probably make sense to you even if I don't know what it was trying to do and why/how it failed...:)
@Mathias Hellquist Just saw your issues on Github. Seems like you hit quite the jackpot! Not sure if you were lucky or unlucky hehe, I'll go for the first one!
@extarys one thing I'm not clear on: does those db errors cause the fact that my instance can't search, at all? Or is that another issue? Should I post that as another issue? I don't know how to describe it further than what I did in the original post in this thread.
@utzer@Mathias Hellquist If you use suPHP or fastPHP so that the code runs as the owner's ID rather than the web server ID, as I do, a good thing to do from a security standpoint as it prevents a security whole in one application from compromising your entire site, then you will want to run the bin/console commands with friendica UID NOT the webserver ID.