Improve result sorting #59

Merged
MrPetovan merged 6 commits from task/improve-result-sorting into master 2018-11-01 16:35:12 +01:00
MrPetovan commented 2018-10-31 16:46:31 +01:00 (Migrated from github.com)

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:

  • Description earns 4 points
  • Any number of Tags earns 2 points
  • Any number of location fields earns 1 point

The profile card now show the region if it isn't the same string as the locality.

Thanks to Adam Clarke for the nudge.

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: - Description earns 4 points - Any number of Tags earns 2 points - Any number of location fields earns 1 point The profile card now show the region if it isn't the same string as the locality. Thanks to Adam Clarke for the nudge.
tobiasd (Migrated from github.com) reviewed 2018-10-31 18:06:05 +01:00
tobiasd (Migrated from github.com) commented 2018-10-31 18:06:05 +01:00

The indentation looks wrong in the github diff. Could you have a look?

The indentation looks wrong in the github diff. Could you have a look?
MrPetovan (Migrated from github.com) reviewed 2018-10-31 18:53:30 +01:00
MrPetovan (Migrated from github.com) commented 2018-10-31 18:53:08 +01:00

It's tabs everywhere, what's the matter?

It's tabs everywhere, what's the matter?
MrPetovan (Migrated from github.com) commented 2018-10-31 18:53:30 +01:00

It's tabs everywhere, what are you seeing wrong?

It's tabs everywhere, what are you seeing wrong?
tobiasd (Migrated from github.com) reviewed 2018-11-01 06:26:37 +01:00
tobiasd (Migrated from github.com) commented 2018-11-01 06:26:37 +01:00

It looks like the indentation depth is jumping in the diff displayed by github.

It looks like the indentation depth is jumping in the diff displayed by github.
annando (Migrated from github.com) reviewed 2018-11-01 07:48:32 +01:00
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
annando (Migrated from github.com) commented 2018-11-01 07:48:31 +01:00

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.

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.
MrPetovan (Migrated from github.com) reviewed 2018-11-01 12:33:17 +01:00
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
MrPetovan (Migrated from github.com) commented 2018-11-01 12:33:17 +01:00

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.

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.
MrPetovan (Migrated from github.com) reviewed 2018-11-01 12:35:06 +01:00
MrPetovan (Migrated from github.com) commented 2018-11-01 12:35:06 +01:00

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.

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.
annando (Migrated from github.com) reviewed 2018-11-01 12:52:07 +01:00
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
annando (Migrated from github.com) commented 2018-11-01 12:52:07 +01:00

Ah, yeah. We already compacted the data. So possibly we should sort by "last_activity" and "filled_fields" instead.

Ah, yeah. We already compacted the data. So possibly we should sort by "last_activity" and "filled_fields" instead.
MrPetovan (Migrated from github.com) reviewed 2018-11-01 12:55:26 +01:00
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
MrPetovan (Migrated from github.com) commented 2018-11-01 12:55:25 +01:00

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.

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.
annando (Migrated from github.com) reviewed 2018-11-01 13:10:14 +01:00
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
annando (Migrated from github.com) commented 2018-11-01 13:10:14 +01:00

Okay. Since we can change that very fast (and since there aren't that many installations), we can test it out.

Okay. Since we can change that very fast (and since there aren't that many installations), we can test it out.
MrPetovan (Migrated from github.com) reviewed 2018-11-01 15:24:24 +01:00
@ -64,3 +64,3 @@
} else {
$order = ' ORDER BY `updated` DESC, `id` DESC ';
$order = ' ORDER BY `filled_fields` DESC, `last_activity` DESC, `updated` DESC';
}
MrPetovan (Migrated from github.com) commented 2018-11-01 15:24:24 +01:00

It's already in place on https://dir.friendica.social anyway!

It's already in place on https://dir.friendica.social anyway!
annando commented 2018-11-01 16:35:36 +01:00 (Migrated from github.com)

P.S.: Could you have a look at https://github.com/friendica/dir/issues/15 as well?

P.S.: Could you have a look at https://github.com/friendica/dir/issues/15 as well?
AlfredSK commented 2018-11-01 21:17:04 +01:00 (Migrated from github.com)

@MrPetovan Is it sufficient to do a 'git pull' to update the directory?

@MrPetovan Is it sufficient to do a 'git pull' to update the directory?
MrPetovan commented 2018-11-01 21:20:01 +01:00 (Migrated from github.com)

Nope, there are changes to the DB structure that aren't applied automatically. Please look at the changes to dfrndir.sql in this PR.

Nope, there are changes to the DB structure that aren't applied automatically. Please look at the changes to `dfrndir.sql` in this PR.
AlfredSK commented 2018-11-01 21:24:02 +01:00 (Migrated from github.com)

Hmm. Is there a dbstructure update command? I cannot find any.

Hmm. Is there a dbstructure update command? I cannot find any.
MrPetovan commented 2018-11-01 21:31:15 +01:00 (Migrated from github.com)

Nope, there never was for directory.

Nope, there never was for directory.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: friendica/dir#59
No description provided.