Improve result sorting #59
Loading…
Reference in New Issue
No description provided.
Delete Branch "task/improve-result-sorting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I finally got around to implement sorting by last activity. In the process, I also sort on number of filled profile fields so that the most verbose results show up first.
The number of filled profile fields is weighted:
The profile card now show the region if it isn't the same string as the locality.
Thanks to Adam Clarke for the nudge.
The indentation looks wrong in the github diff. Could you have a look?
It's tabs everywhere, what's the matter?
It's tabs everywhere, what are you seeing wrong?
It looks like the indentation depth is jumping in the diff displayed by github.
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
Wouldn't it be better if the sorting would be by the month of the last update and then the number of filled fields? Sorting after the filled fields at first could put someone at first who had filled out all fields - but hadn't been active for years.
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
The last_actitivy is
YYYY-WW
with WW being the week number in the year, so we can't sort on the month if it made any sense. Besides, this sorting is only to improve the visual impression of the default display of the directory. The first page will always have filled profiles with recent activity. What happens in the subsequent pages is way less relevant.If you're talking about the SQL query strings, it's intentional, a old habit I took when I was outputting the queries for debug and I loathed the extra white spaces in the debug display. So I started pulling the queries left to remove the tabs/spaces.
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
Ah, yeah. We already compacted the data. So possibly we should sort by "last_activity" and "filled_fields" instead.
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
And then you'd have all the spam bots without any profile info first. Believe me, I thought about it, I tried different orders, and this was the most visually gratifying.
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
Okay. Since we can change that very fast (and since there aren't that many installations), we can test it out.
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
It's already in place on https://dir.friendica.social anyway!
P.S.: Could you have a look at https://github.com/friendica/dir/issues/15 as well?
@MrPetovan Is it sufficient to do a 'git pull' to update the directory?
Nope, there are changes to the DB structure that aren't applied automatically. Please look at the changes to
dfrndir.sql
in this PR.Hmm. Is there a dbstructure update command? I cannot find any.
Nope, there never was for directory.