twSearch.deleteAll(index1, twSearch.getIndexType());
twSearch.deleteAll(index2, twSearch.getIndexType());
twSearch.deleteAll(resindex, twSearch.getIndexType());
// this store makes a problem later on, when searching on index1
twSearch.bulkUpdate(Arrays.asList(new JTweet(1L, "test", new JUser("testuser"))), index1, true);
List<JTweet> list = new ArrayList<JTweet>();
JUser user = new JUser("peter");
for (int i = 0; i < 100; i++) {
list.add(new JTweet(i, "hey cool one", user));
}
JUser user2 = new JUser("peter2");
for (int i = 100; i < 200; i++) {
list.add(new JTweet(i, "nice day", user2));
}
twSearch.bulkUpdate(list, index1, true);
// identical tweets -> TODO do or don't store?
List<JTweet> list2 = new ArrayList<JTweet>();
for (int i = 0; i < 100; i++) {
list2.add(new JTweet(i, "[updated] hey cool one", user));
}
// different tweets
JUser user3 = new JUser("peter3");
for (int i = 300; i < 400; i++) {
list2.add(new JTweet(i, "what's going on?", user3));
}
twSearch.bulkUpdate(list2, index2, true);
// System.out.println("1:" + twSearch.countAll(index1) + " 2:" + twSearch.countAll(index2) + " res:" + twSearch.countAll(resindex));