Commit Graph

27 Commits

Author SHA1 Message Date
barisusakli
cd096f8832 sortedSetScores for tag counts 2014-08-15 11:48:01 -04:00
barisusakli
e10eaf0d50 added tag counts to api return 2014-08-14 21:12:12 -04:00
barisusakli
5e68e0b009 same deal as previous commit 2014-08-11 15:41:45 -04:00
barisusakli
e137baccd9 fixed ip:recent weird 2014-08-11 13:47:24 -04:00
barisusakli
528ee335d5 optimize getTopicsByTids and getTeasers 2014-08-06 21:30:11 -04:00
barisusakli
b4182f57fe simplified callback 2014-08-04 13:00:42 -04:00
barisusakli
eeb4c9f487 optimize getPostSummaryByPids 2014-07-29 17:33:28 -04:00
barisusakli
d7520508e3 #1375 part1 2014-07-28 18:18:20 -04:00
psychobunny
7327730252 LTRIM support for redis 2014-07-28 14:20:24 -04:00
barisusakli
3829019bfa removed optional params 2014-07-24 23:33:33 -04:00
barisusakli
89bb11a58c closes #1880 2014-07-22 12:56:34 -04:00
barisusakli
9aacb5e259 remove dupe code 2014-06-29 14:10:20 -04:00
barisusakli
c3a9767bf6 late night optimizations
-isMemberOfSets returns true/false instead of 1/0
-when loading the posts of a topic only get the userdata for each user
once, before this commit if a topic had 10 posts from 2 different users
we were getting the user data for each user 5 times (drunk)
-getVoteStatusByPostIDs and getFavouritesByPostIDs no longer make
pids.length calls to the db, they use isMemberOfSets now
-getUserInfoForPost renamed to getUserInfoForPosts and doesnt make
uids.length calls to db, uses getMultipleUserFields instead
2014-06-28 01:03:26 -04:00
barisusakli
d3fc71529a callback 2014-06-27 23:23:27 -04:00
barisusakli
f80b3c3b66 simpler union 2014-06-25 18:27:22 -04:00
barisusakli
7f534cc7b8 sorted set refactor 2014-06-25 18:16:42 -04:00
barisusakli
e6d8e9c959 searchIndex callbacks 2014-06-24 09:15:44 -04:00
barisusakli
fd12ec763a sortedSetsRemove
instead of calling sortedSetRemove() one at a time for each id remove
value from multiple sortedSets with one db call
2014-06-21 22:37:46 -04:00
Charles
90b2d766f7 Fix callback execution in redis search
`callback` should be passed to `reds.search` otherwise the execution will be overlapped. 

For example in the plugin `nodebb-plugin-dbsearch':

```javascript
db.searchRemove('topic', tid, function() {
	if (typeof title === 'string' && title.length) {
		db.searchIndex('topic', title, tid);
	}

	if (typeof callback === 'function') {
		callback();
	}
});
```

The actual execution is like this

```
1402387863.625553 [0 127.0.0.1:16660] "zrevrangebyscore" "nodebbtopicsearch:object:6" "+inf" "0"
1402387863.625891 [0 127.0.0.1:16660] "MULTI"
1402387863.626043 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:123" "1" "6"
1402387863.626052 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "123"
1402387863.626060 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:TST" "1" "6"
1402387863.626065 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "TST"
1402387863.626071 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:AN0" "1" "6"
1402387863.626076 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "AN0"
1402387863.626083 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:TPK" "1" "6"
1402387863.626092 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "TPK"
1402387863.626104 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:ETTT" "1" "6"
1402387863.626116 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "ETTT"
1402387863.626130 [0 127.0.0.1:16660] "EXEC"
1402387863.626253 [0 127.0.0.1:16660] "del" "topic:6:tags"
1402387863.626281 [0 127.0.0.1:16660] "MULTI"
1402387863.626515 [0 127.0.0.1:16660] "del" "nodebbtopicsearch:object:6"
1402387863.626524 [0 127.0.0.1:16660] "EXEC"
```

The key nodebbtopicsearch:object is added and then just being deleted again.
2014-06-10 15:30:53 +07:00
Julian Lam
7afe3bea59 added getSortedSetRevUnion... just because. 2014-05-23 09:49:18 -04:00
Julian Lam
6e597a9cdb fixed tests, and added getSortedSetUnion method to redis db, added test for new redis method 2014-05-23 09:49:18 -04:00
barisusakli
746df87d89 upgrade tags to sorted set 2014-05-22 13:06:19 -04:00
Julian Lam
e64c1bfec3 closed #1453 2014-05-11 11:45:20 -04:00
Julian Lam
bab140c396 added pexpire and pexpireAt methods for redis and mongo. Added emoticons for leveldb (as per existing implementation by @psychobunny LOL) 2014-05-11 10:31:32 -04:00
psychobunny
290e348851 move database helpers into their own files 2014-04-14 15:09:57 -04:00
psychobunny
bba3df6802 moving db.close into the parent module 2014-04-14 13:51:45 -04:00
psychobunny
9ad7ce9ca8 organizing redis driver 2014-04-11 15:29:01 -04:00