-
-
Save keyball/80672e965e205752a282d3212c3517ff to your computer and use it in GitHub Desktop.
ElasticsearchConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And this is the PHP array I'm using to feed the "bulk" method of ElasticSearch-PHP. | |
The unique IDs will be generated from the id of the entry with: sprintf( '%013d', $activity->id ) | |
Array | |
( | |
[body] => Array | |
( | |
[0] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000002 | |
) | |
) | |
[1] => Array | |
( | |
[id] => 2 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 46 | |
[content_type] => 1 | |
[audio_duration] => 1083 | |
[latitude] => 50.9987876 | |
[longitude] => 6.9876660 | |
[last_interaction_at] => 2016-11-11 10:23:36 | |
[created_at] => 2016-11-11 10:23:36 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 100 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 1 | |
[1] => 2 | |
[2] => 30 | |
[3] => 31 | |
[4] => 32 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.987666 | |
[lat] => 50.9987876 | |
) | |
) | |
) | |
[2] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000003 | |
) | |
) | |
[3] => Array | |
( | |
[id] => 3 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 47 | |
[content_type] => 1 | |
[audio_duration] => 1050 | |
[latitude] => | |
[longitude] => | |
[last_interaction_at] => 2016-11-11 10:24:24 | |
[created_at] => 2016-11-11 10:24:24 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 3 | |
[1] => 4 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
[0] => 15 | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 0 | |
[lat] => 0 | |
) | |
) | |
) | |
[4] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000004 | |
) | |
) | |
[5] => Array | |
( | |
[id] => 4 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 48 | |
[content_type] => 1 | |
[audio_duration] => 5083 | |
[latitude] => | |
[longitude] => | |
[last_interaction_at] => 2016-11-11 10:27:51 | |
[created_at] => 2016-11-11 10:27:51 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 5 | |
[1] => 6 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 0 | |
[lat] => 0 | |
) | |
) | |
) | |
[6] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000005 | |
) | |
) | |
[7] => Array | |
( | |
[id] => 5 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 49 | |
[content_type] => 1 | |
[audio_duration] => 10747 | |
[latitude] => | |
[longitude] => | |
[last_interaction_at] => 2016-11-16 14:46:10 | |
[created_at] => 2016-11-16 14:46:10 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 7 | |
[1] => 8 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 0 | |
[lat] => 0 | |
) | |
) | |
) | |
[8] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000006 | |
) | |
) | |
[9] => Array | |
( | |
[id] => 6 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 50 | |
[content_type] => 1 | |
[audio_duration] => 2000 | |
[latitude] => | |
[longitude] => | |
[last_interaction_at] => 2016-11-16 14:47:13 | |
[created_at] => 2016-11-16 14:47:13 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 9 | |
[1] => 10 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
[0] => 16 | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 0 | |
[lat] => 0 | |
) | |
) | |
) | |
[10] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000007 | |
) | |
) | |
[11] => Array | |
( | |
[id] => 7 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 51 | |
[content_type] => 1 | |
[audio_duration] => 837 | |
[latitude] => 51.6666666 | |
[longitude] => 6.9878786 | |
[last_interaction_at] => 2016-11-16 14:48:32 | |
[created_at] => 2016-11-16 14:48:32 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 11 | |
[1] => 12 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.9878786 | |
[lat] => 51.6666666 | |
) | |
) | |
) | |
[12] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000008 | |
) | |
) | |
[13] => Array | |
( | |
[id] => 8 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 52 | |
[content_type] => 1 | |
[audio_duration] => 7017 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:51:46 | |
[created_at] => 2016-11-16 14:51:46 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 13 | |
[1] => 14 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[14] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000009 | |
) | |
) | |
[15] => Array | |
( | |
[id] => 9 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 53 | |
[content_type] => 1 | |
[audio_duration] => 12848 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:52:37 | |
[created_at] => 2016-11-16 14:52:37 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 15 | |
[1] => 16 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[16] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000010 | |
) | |
) | |
[17] => Array | |
( | |
[id] => 10 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 54 | |
[content_type] => 1 | |
[audio_duration] => 4575 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:52:40 | |
[created_at] => 2016-11-16 14:52:40 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 17 | |
[1] => 18 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[18] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000011 | |
) | |
) | |
[19] => Array | |
( | |
[id] => 11 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 55 | |
[content_type] => 1 | |
[audio_duration] => 13982 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:52:44 | |
[created_at] => 2016-11-16 14:52:44 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 19 | |
[1] => 20 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[20] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000012 | |
) | |
) | |
[21] => Array | |
( | |
[id] => 12 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 56 | |
[content_type] => 1 | |
[audio_duration] => 4237 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:52:47 | |
[created_at] => 2016-11-16 14:52:47 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 21 | |
[1] => 22 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[22] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000013 | |
) | |
) | |
[23] => Array | |
( | |
[id] => 13 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 57 | |
[content_type] => 1 | |
[audio_duration] => 13651 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:53:02 | |
[created_at] => 2016-11-16 14:53:02 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 1 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 23 | |
[1] => 24 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[24] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000014 | |
) | |
) | |
[25] => Array | |
( | |
[id] => 14 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 58 | |
[content_type] => 1 | |
[audio_duration] => 3576 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-16 14:53:05 | |
[created_at] => 2016-11-16 14:53:05 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 1 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 5000 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 25 | |
[1] => 26 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
) | |
[source] => | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[26] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000015 | |
) | |
) | |
[27] => Array | |
( | |
[id] => 15 | |
[parent_id] => | |
[reply_to_id] => | |
[file_id] => 59 | |
[content_type] => 1 | |
[audio_duration] => 10648 | |
[latitude] => 50.6667800 | |
[longitude] => 6.9889870 | |
[last_interaction_at] => 2016-11-17 12:52:46 | |
[created_at] => 2016-11-17 12:52:46 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 1 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 10000 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
[0] => 27 | |
[1] => 28 | |
) | |
[tags] => Array | |
( | |
[0] => Array | |
( | |
[tag] => 🔪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:46 | |
) | |
[1] => Array | |
( | |
[tag] => unit_test | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
[2] => Array | |
( | |
[tag] => 🇩🇪 | |
[score] => 14 | |
[created_at] => 2016-11-11 10:23:47 | |
) | |
) | |
[replies] => Array | |
( | |
[0] => 16 | |
) | |
[source] => 3 | |
[parent] => | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 6.988987 | |
[lat] => 50.66678 | |
) | |
) | |
) | |
[28] => Array | |
( | |
[index] => Array | |
( | |
[_index] => activities | |
[_type] => activity | |
[_id] => 0000000000016 | |
) | |
) | |
[29] => Array | |
( | |
[id] => 16 | |
[parent_id] => 15 | |
[reply_to_id] => 15 | |
[file_id] => 59 | |
[content_type] => 1 | |
[audio_duration] => 4533 | |
[latitude] => | |
[longitude] => | |
[last_interaction_at] => 2016-11-18 14:23:57 | |
[created_at] => 2016-11-18 14:23:59 | |
[deleted_at] => | |
[statistics] => Array | |
( | |
[unique_plays_count] => 0 | |
[plays_count] => 0 | |
[likes_count] => 0 | |
[replies_count] => 0 | |
[shares_count] => 0 | |
[score] => 0 | |
[weight] => 0 | |
) | |
[user] => Array | |
( | |
[id] => 3 | |
) | |
[mentions] => Array | |
( | |
) | |
[tags] => Array | |
( | |
) | |
[replies] => Array | |
( | |
) | |
[source] => 6 | |
[parent] => 15 | |
[reposts] => Array | |
( | |
) | |
[geopoint] => Array | |
( | |
[location] => stdClass Object | |
( | |
[lon] => 0 | |
[lat] => 0 | |
) | |
) | |
) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
CREATE TABLE activities | |
( | |
id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, | |
user_id INT(10) unsigned NOT NULL, | |
parent_id INT(10) unsigned, | |
reply_to_id INT(10) unsigned, | |
source_id INT(10) unsigned, | |
file_id INT(10) unsigned, | |
content_type TINYINT(2) unsigned, | |
audio_duration SMALLINT(5) unsigned NOT NULL, | |
latitude DECIMAL(10,7), | |
longitude DECIMAL(10,7), | |
last_interaction_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | |
created_at TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, | |
updated_at TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL, | |
deleted_at TIMESTAMP | |
); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 1, 1, 2392, null, null, '2016-11-05 11:43:16', '2016-10-24 11:43:16', '2016-11-16 13:21:43', '2016-11-16 13:21:43'); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 46, 1, 1083, 50.9987876, 6.9876660, '2016-11-11 11:23:36', '2016-11-11 11:23:36', '2016-11-11 11:23:36', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 47, 1, 1050, null, null, '2016-11-11 11:24:24', '2016-11-11 11:24:24', '2016-11-11 11:24:24', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 48, 1, 5083, null, null, '2016-11-11 11:27:51', '2016-11-11 11:27:51', '2016-11-11 11:27:51', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 49, 1, 10747, null, null, '2016-11-16 15:46:10', '2016-11-16 15:46:10', '2016-11-16 15:46:10', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 50, 1, 2000, null, null, '2016-11-16 15:47:13', '2016-11-16 15:47:13', '2016-11-16 15:47:13', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 51, 1, 837, 51.6666666, 6.9878786, '2016-11-16 15:48:32', '2016-11-16 15:48:32', '2016-11-16 15:48:32', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 52, 1, 7017, 50.6667800, 6.9889870, '2016-11-16 15:51:46', '2016-11-16 15:51:46', '2016-11-16 15:51:46', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 53, 1, 12848, 50.6667800, 6.9889870, '2016-11-16 15:52:37', '2016-11-16 15:52:37', '2016-11-16 15:52:37', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 54, 1, 4575, 50.6667800, 6.9889870, '2016-11-16 15:52:40', '2016-11-16 15:52:40', '2016-11-16 15:52:40', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 55, 1, 13982, 50.6667800, 6.9889870, '2016-11-16 15:52:44', '2016-11-16 15:52:44', '2016-11-16 15:52:44', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 56, 1, 4237, 50.6667800, 6.9889870, '2016-11-16 15:52:47', '2016-11-16 15:52:47', '2016-11-16 15:52:47', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 57, 1, 13651, 50.6667800, 6.9889870, '2016-11-16 15:53:02', '2016-11-16 15:53:02', '2016-11-16 15:53:02', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, null, 58, 1, 3576, 50.6667800, 6.9889870, '2016-11-16 15:53:05', '2016-11-16 15:53:05', '2016-11-16 15:53:05', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, null, null, 3, 59, 1, 10648, 50.6667800, 6.9889870, '2016-11-17 13:52:46', '2016-11-17 13:52:46', '2016-11-17 13:52:46', null); | |
INSERT INTO activities (user_id, parent_id, reply_to_id, source_id, file_id, content_type, audio_duration, latitude, longitude, last_interaction_at, created_at, updated_at, deleted_at) VALUES (3, 15, 15, 6, 59, 1, 4533, null, null, '2016-11-18 15:23:57', '2016-11-18 15:23:59', '2016-11-18 15:24:01', null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query: 1. page | |
POST activities/activity/_search | |
{ | |
"_source": [ | |
"id" | |
], | |
"query": { | |
"bool": { | |
"must": { | |
"match_all": {} | |
}, | |
"filter": { | |
"geo_distance": { | |
"distance": "100.000000km", | |
"geopoint.location": { | |
"lat": 50.931788, | |
"lon": 6.940588 | |
} | |
} | |
} | |
} | |
}, | |
"search_after": [ | |
0, | |
"activity#0000000000001" | |
], | |
"sort": [ | |
{ | |
"_geo_distance": { | |
"geopoint.location": { | |
"lat": 50.9317882, | |
"lon": 6.9405879 | |
}, | |
"order": "asc", | |
"unit": "km", | |
"mode": "min", | |
"distance_type": "sloppy_arc" | |
} | |
}, | |
"_uid" | |
], | |
"track_scores": true, | |
"from": 0, | |
"size": 5 | |
} | |
Results: | |
{ | |
"took": 19, | |
"timed_out": false, | |
"_shards": { | |
"total": 5, | |
"successful": 5, | |
"failed": 0 | |
}, | |
"hits": { | |
"total": 10, | |
"max_score": 1, | |
"hits": [ | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000002", | |
"_score": 1, | |
"_source": { | |
"id": 2 | |
}, | |
"sort": [ | |
8.146888754906811, | |
"activity#0000000000002" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000008", | |
"_score": 1, | |
"_source": { | |
"id": 8 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000008" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000009", | |
"_score": 1, | |
"_source": { | |
"id": 9 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000009" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000010", | |
"_score": 1, | |
"_source": { | |
"id": 10 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000010" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000011", | |
"_score": 1, | |
"_source": { | |
"id": 11 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000011" | |
] | |
} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"activities" : { | |
"mappings" : { | |
"activity" : { | |
"dynamic_date_formats" : [ | |
"yyyy-MM-dd", | |
"dd-MM-yyyy", | |
"yyyy-MM-dd HH:mm:ss" | |
], | |
"properties" : { | |
"audio_duration" : { | |
"type" : "long" | |
}, | |
"content_type" : { | |
"type" : "long" | |
}, | |
"created_at" : { | |
"type" : "date", | |
"format" : "yyyy-MM-dd HH:mm:ss" | |
}, | |
"file_id" : { | |
"type" : "long" | |
}, | |
"geopoint" : { | |
"properties" : { | |
"location" : { | |
"type" : "geo_point", | |
"store" : true | |
} | |
} | |
}, | |
"id" : { | |
"type" : "long" | |
}, | |
"last_interaction_at" : { | |
"type" : "date", | |
"format" : "yyyy-MM-dd HH:mm:ss" | |
}, | |
"latitude" : { | |
"type" : "text", | |
"fields" : { | |
"keyword" : { | |
"type" : "keyword", | |
"ignore_above" : 256 | |
} | |
} | |
}, | |
"longitude" : { | |
"type" : "text", | |
"fields" : { | |
"keyword" : { | |
"type" : "keyword", | |
"ignore_above" : 256 | |
} | |
} | |
}, | |
"mentions" : { | |
"type" : "long" | |
}, | |
"parent" : { | |
"type" : "long" | |
}, | |
"parent_id" : { | |
"type" : "long" | |
}, | |
"replies" : { | |
"type" : "long" | |
}, | |
"reply_to_id" : { | |
"type" : "long" | |
}, | |
"reposts" : { | |
"type" : "long" | |
}, | |
"source" : { | |
"type" : "long" | |
}, | |
"statistics" : { | |
"properties" : { | |
"likes_count" : { | |
"type" : "long" | |
}, | |
"plays_count" : { | |
"type" : "long" | |
}, | |
"replies_count" : { | |
"type" : "long" | |
}, | |
"score" : { | |
"type" : "long" | |
}, | |
"shares_count" : { | |
"type" : "long" | |
}, | |
"unique_plays_count" : { | |
"type" : "long" | |
}, | |
"weight" : { | |
"type" : "long" | |
} | |
} | |
}, | |
"tags" : { | |
"properties" : { | |
"created_at" : { | |
"type" : "date", | |
"format" : "yyyy-MM-dd HH:mm:ss" | |
}, | |
"score" : { | |
"type" : "long" | |
}, | |
"tag" : { | |
"type" : "text", | |
"analyzer" : "english_with_emoji" | |
} | |
} | |
}, | |
"user" : { | |
"properties" : { | |
"id" : { | |
"type" : "long" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query 2: | |
POST activities/activity/_search | |
{ | |
"_source": [ | |
"id" | |
], | |
"query": { | |
"bool": { | |
"must": { | |
"match_all": {} | |
}, | |
"filter": { | |
"geo_distance": { | |
"distance": "100.000000km", | |
"geopoint.location": { | |
"lat": 50.931788, | |
"lon": 6.940588 | |
} | |
} | |
} | |
} | |
}, | |
"search_after": [ | |
29, | |
"activity#0000000000011" | |
], | |
"sort": [ | |
{ | |
"_geo_distance": { | |
"geopoint.location": { | |
"lat": 50.9317882, | |
"lon": 6.9405879 | |
}, | |
"order": "asc", | |
"unit": "km", | |
"mode": "min", | |
"distance_type": "sloppy_arc" | |
} | |
}, | |
"_uid" | |
], | |
"track_scores": true, | |
"from": 0, | |
"size": 5 | |
} | |
Results: | |
{ | |
"took": 8, | |
"timed_out": false, | |
"_shards": { | |
"total": 5, | |
"successful": 5, | |
"failed": 0 | |
}, | |
"hits": { | |
"total": 10, | |
"max_score": 1, | |
"hits": [ | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000008", | |
"_score": 1, | |
"_source": { | |
"id": 8 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000008" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000009", | |
"_score": 1, | |
"_source": { | |
"id": 9 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000009" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000010", | |
"_score": 1, | |
"_source": { | |
"id": 10 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000010" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000011", | |
"_score": 1, | |
"_source": { | |
"id": 11 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000011" | |
] | |
}, | |
{ | |
"_index": "activities", | |
"_type": "activity", | |
"_id": "0000000000012", | |
"_score": 1, | |
"_source": { | |
"id": 12 | |
}, | |
"sort": [ | |
29.663276081577074, | |
"activity#0000000000012" | |
] | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment