fixing the fixing of the fix
parent
4f9e9d02e3
commit
dcc888dfce
40
README.md
40
README.md
|
@ -90,32 +90,34 @@ print("100 accounts that follow the most of the accounts found in 2)",followed_t
|
||||||
|
|
||||||
* 4.4 Caching der Posts für die Startseite (vgl. 4), erfordert einen sog. Fan-Out in den Cache jedes Followers beim Schreiben eines neuen Posts
|
* 4.4 Caching der Posts für die Startseite (vgl. 4), erfordert einen sog. Fan-Out in den Cache jedes Followers beim Schreiben eines neuen Posts
|
||||||
|
|
||||||
CREATE MATERIALIZED VIEW twitter.start_view_user1 AS
|
```
|
||||||
SELECT follower_id,number_of_likes,date_time,author,name,content,id FROM twitter.user
|
CREATE MATERIALIZED VIEW twitter.start_view_user1 AS
|
||||||
WHERE user_id_x IS NOT NULL AND user_id_x=172883064 AND follower_id IS NOT NULL AND number_of_likes IS NOT NULL AND id IS NOT NULL
|
SELECT follower_id,number_of_likes,date_time,author,name,content,id FROM twitter.user
|
||||||
PRIMARY KEY ((user_id_x),number_of_likes,follower_id,id);
|
WHERE user_id_x IS NOT NULL AND user_id_x=172883064 AND follower_id IS NOT NULL AND number_of_likes IS NOT NULL AND id IS NOT NULL
|
||||||
|
PRIMARY KEY ((user_id_x),number_of_likes,follower_id,id);
|
||||||
|
|
||||||
// # order by need partion key in WHERE
|
// # order by need partion key in WHERE
|
||||||
SELECT * from twitter.start_view_taylor WHERE user_id_x=172883064 ORDER BY number_of_likes DESC LIMIT 25;
|
SELECT * from twitter.start_view_taylor WHERE user_id_x=172883064 ORDER BY number_of_likes DESC LIMIT 25;
|
||||||
// INSERT new tweet
|
// INSERT new tweet
|
||||||
INSERT INTO twitter.user
|
INSERT INTO twitter.user
|
||||||
(user_id_x,follower_id,name,author ,content ,country ,date_time ,id ,language ,latitude ,longitude ,number_of_likes ,number_of_shares ,user_id_y)
|
(user_id_x,follower_id,name,author ,content ,country ,date_time ,id ,language ,latitude ,longitude ,number_of_likes ,number_of_shares ,user_id_y)
|
||||||
VALUES
|
VALUES
|
||||||
(172883064, 233248636, 'NoName','taylorswift12', 'Hallo there BDEA','DE', dateof(now()), 'NoID', 'de', 48, 48, 10000000, 0, 0);
|
(172883064, 233248636, 'NoName','taylorswift12', 'Hallo there BDEA','DE', dateof(now()), 'NoID', 'de', 48, 48, 10000000, 0, 0);
|
||||||
|
|
||||||
INSERT INTO twitter.tweets(author, content, country, date_time, id, language, latitude, longitude, number_of_likes, number_of_shares ,author_id)
|
INSERT INTO twitter.tweets(author, content, country, date_time, id, language, latitude, longitude, number_of_likes, number_of_shares ,author_id)
|
||||||
VALUES
|
VALUES
|
||||||
('taylorswift12', 'Hallo there BDEA','DE', dateof(now()), 'NoID', 'de', 48, 48, 10000000, 0, 233248636);
|
('taylorswift12', 'Hallo there BDEA','DE', dateof(now()), 'NoID', 'de', 48, 48, 10000000, 0, 233248636);
|
||||||
|
```
|
||||||
![result_ex4_2](img/ex4_2_likes.png)
|
![result_ex4_2](img/ex4_2_likes.png)
|
||||||
|
|
||||||
|
|
||||||
* 4.5 Auflisten der 25 beliebtesten Posts, die ein geg. Wort enthalten (falls möglich auch mit UND-Verknüpfung mehrerer Worte)
|
* 4.5 Auflisten der 25 beliebtesten Posts, die ein geg. Wort enthalten (falls möglich auch mit UND-Verknüpfung mehrerer Worte)
|
||||||
|
|
||||||
CREATE CUSTOM INDEX search_in ON twitter.tweets (content) USING 'org.apache.cassandra.index.sasi.SASIIndex'
|
```
|
||||||
WITH OPTIONS = { 'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer',
|
CREATE CUSTOM INDEX search_in ON twitter.tweets (content) USING 'org.apache.cassandra.index.sasi.SASIIndex'
|
||||||
'case_sensitive': 'false' };
|
WITH OPTIONS = { 'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer',
|
||||||
SELECT * from twitter.tweets WHERE content LIKE '%world%' limit 25;
|
'case_sensitive': 'false' };
|
||||||
|
SELECT * from twitter.tweets WHERE content LIKE '%world%' limit 25;
|
||||||
|
```
|
||||||
![result_ex4_2](img/ex6.png)
|
![result_ex4_2](img/ex6.png)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue