Skip to content

Instantly share code, notes, and snippets.

@monken
Created March 19, 2011 12:31
Show Gist options
  • Select an option

  • Save monken/877449 to your computer and use it in GitHub Desktop.

Select an option

Save monken/877449 to your computer and use it in GitHub Desktop.
$ prove -lv t/00-request.t
t/00-request.t ..
1..266
ok 1 - use ElasticSearch;
ok 2 - use ElasticSearch::TestServer;
#
# Testing ElasticSearch 0.31, Perl 5.012003, /Users/mo/perl5/perlbrew/perls/perl-5.12.3/bin/perl
# Transport: http (Set ES_TRANSPORT=http|httplite|thrift)
#
Starting test server installed in /Users/mo/Downloads/elasticsearch-0.15.2
56662 STARTING SERVERS
56662: Starting test node 1
IN 56662
56662: Starting test node 2
IN 56662
56662: Starting test node 3
IN 56662
56662 Waiting for servers to warm up
Node running on 127.0.0.1:9200
Node running on 127.0.0.1:9201
Node running on 127.0.0.1:9202
ok 3 - Connected to an ES cluster
ok 4 - Current server set
# Creating indices
#
# Testing: version
# ----------------
ok 5 - Current server version isa HASH
ok 6 - - has a version string
ok 7 - - has a build date
ok 8 - - has snapshot_build
# Current server is version 0.15.2
# Built: 2011-03-07T11:57:46
#
# Testing: cluster_state
# ----------------------
ok 9 - Cluster state isa HASH
ok 10 - - allocations isa ARRAY
ok 11 - - cluster name
ok 12 - - master node
ok 13 - - blocks isa HASH
ok 14 - - routing_table isa HASH
ok 15 - - routing_nodes isa HASH
ok 16 - - nodes isa HASH
ok 17 - - metadata isa HASH
ok 18 - - metadata has 2 indices
ok 19 - Filtered cluster state
ok 20 - - filtered metadata has 1 index
#
# Testing: cluster_health
# -----------------------
ok 21 - Cluster health isa HASH
ok 22 - - wait_for_status
ok 23 - - wait_for_relocating_shards
ok 24 - - wait_for_nodes
ok 25 - - timeout
ok 26 - - level cluster
ok 27 - - level indices
ok 28 - - level shards
#
# Testing: nodes
# --------------
ok 29 - All nodes isa HASH
ok 30 - - has cluster_name
ok 31 - - has nodes isa HASH
ok 32 - - 3 nodes
ok 33 - - request single node
ok 34 - - got one node
ok 35 - - got same node
ok 36 - - nodes by name isa HASH
ok 37 - - retrieved same number of nodes
ok 38 - - retrieved the same nodes
ok 39 - - without settings
ok 40 - - with settings isa HASH
ok 41 - - nodes_stats isa HASH
ok 42 - - stats detail
#
# Testing: module_options
# -----------------------
ok 43 - Camel case on
ok 44 - - got camel case
ok 45 - - camel case off
ok 46 - - got underscores
ok 47 - Error trace on
ok 48 - The object isa ElasticSearch::Error::Request
ok 49 - - has error_trace
ok 50 - error_trace off
#
# Testing: create_index
# ---------------------
ok 51 - Created index
ok 52 - - second create fails
ok 53 - - multiple indices fails
ok 54 - - with settings and mappings
ok 55 - - number of shards stored
ok 56 - - analyzer stored
ok 57 - - mappings stored
ok 58 - - analyzer mapped
#
# Testing: index_status
# ---------------------
ok 59 - Index status - all
ok 60 - - Index 1 exists
ok 61 - - Index 2 exists
ok 62 - - Index 2 settings
ok 63 - - index missing
#
# Testing: update_settings
# ------------------------
ok 64 - Update index settings
ok 65 - - has 2 replicas
ok 66 - - reset to 1 replica
ok 67 - - has 1 replica
ok 68 - - index missing
#
# Testing: index_admin
# --------------------
ok 69 - Refresh index
ok 70 - Flush index
ok 71 - - with refresh
ok 72 - - with full
ok 73 - Optimize all indices
ok 74 - - only_deletes
ok 75 - - without flush
ok 76 - - without refresh
ok 77 - - without wait_for_merge
ok 78 - - with max_num_segments
ok 79 - Snapshot all indices
ok 80 - - with gateway_snapshot
ok 81 - Snapshot test indices
ok 82 - - with gateway_snapshot
ok 83 - refresh_index index missing
ok 84 - flush_index index missing
ok 85 - optimize_index index missing
ok 86 - snapshot_index index missing
ok 87 - gateway_snapshot index missing
#
# Testing: analyze
# ----------------
ok 88 - Analyzer
#
# Testing: clear_cache
# --------------------
ok 89 - Clear all index caches
ok 90 - - just index 1
ok 91 - - index 1 and 2
ok 92 - - field cache populated
ok 93 - - filter cache populated
ok 94 - - clear field cache
ok 95 - - field cache cleared
ok 96 - - filter cache not cleared
ok 97 - - field cache populated
ok 98 - - filter cache populated
ok 99 - - clear filter cache
ok 100 - - field cache not cleared
ok 101 - - filter cache cleared
ok 102 - - cache types
ok 103 - - index missing
#
# Testing: index_alias
# --------------------
ok 104 - add alias_1
ok 105 - alias_1 added
ok 106 - add and remove alias_1
ok 107 - alias_1 changed
#
# Testing: open_close_index
# -------------------------
ok 108 - Closed index
ok 109 - - index missing
ok 110 - Opened index
ok 111 - - index reopened
#
# Testing: delete_index
# ---------------------
ok 112 - Delete index
ok 113 - - index deleted
ok 114 - - ignore_missing
#
# Testing: index_templates
# ------------------------
ok 115 - index template - create
ok 116 - - index 1 has 1 shard
ok 117 - - index 2 has 5 shards
ok 118 - - template retrieved
ok 119 - Delete template
ok 120 - - template deleted
ok 121 - - template missing
ok 122 - - ignore missing
#
# Testing: rivers
# ---------------
ok 123 - Create river
ok 124 - Get river
ok 125 - River status
ok 126 - Delete river
ok 127 - - get_river missing
ok 128 - - get_river ignore_missing
ok 129 - - river_status missing
ok 130 - - river_status ignore_missing
# Creating indices
#
# Testing: index_and_create
# -------------------------
ok 131 - Create document
ok 132 - - create conflict
ok 133 - Index document
ok 134 - - index conflict 1
ok 135 - - index conflict 2
ok 136 - - index correct version
#
# Testing: get
# ------------
ok 137 - Get document
ok 138 - - with refresh
ok 139 - - specify fields
not ok 140 # TODO & SKIP Empty fields param not working in 0.15.2
not ok 141 # TODO & SKIP Empty fields param not working in 0.15.2
ok 142 - - id missing
ok 143 - - type missing
ok 144 - - index missing
ok 145 - - id ignore missing
ok 146 - - type ignore missing
ok 147 - - index ignore missing
#
# Testing: delete
# ---------------
ok 148 - Delete - missing
ok 149 - - ignore missing
ok 150 - - version conflict
ok 151 - - version delete with options
#
# Testing: mapping
# ----------------
ok 152 - Put mapping
ok 153 - - conflicted mapping
ok 154 - - valid field not merged
ok 155 - - ignore conflict
ok 156 - - valid field merged
ok 157 - Dynamic mapping enabled
ok 158 - - disabled
ok 159 - - strict
ok 160 - Delete mapping
ok 161 - - ignores missing
#
# Testing: bulk
# -------------
ok 162 - Bulk actions
ok 163 - - 5 actions
ok 164 - - 5 results
ok 165 - - 1 error
ok 166 - - error has action
ok 167 - - error has message
ok 168 - - 2 docs indexed
ok 169 - - roundtrip - bulk_create
ok 170 - - 2 docs created
ok 171 - - roundtrip - bulk_index
ok 172 - - 2 docs reindexed
ok 173 - - bulk_delete
ok 174 - - 2 docs deleted
# Creating indices
# Loading test docs
#
# Testing: search_query
# ---------------------
ok 175 - Match all isa HASH
ok 176 - - total correct
ok 177 - - returned 10 results
ok 178 - - max score 1
ok 179 - Match none isa HASH
ok 180 - - total correct
ok 181 - - returned 10 results
ok 182 - - max score exists
ok 183 - - max score not defined
ok 184 - Match text: foo isa HASH
ok 185 - - total correct
ok 186 - Match text: bar foo isa HASH
#
# Testing: search_from_size
# -------------------------
ok 187 - Match up to 100 isa HASH
ok 188 - - total correct
ok 189 - - returned 29 results
ok 190 - Query with size and from
ok 191 - - number of hits correct
ok 192 - - started from correct pos
#
# Testing: search_types
# ---------------------
ok 193 - query_then_fetch isa HASH
ok 194 - - total correct
ok 195 - - returned 10 results
ok 196 - query_and_fetch isa HASH
ok 197 - - total correct
ok 198 - - returned > 10 results
#
# Testing: search_facets
# ----------------------
ok 199 - Facets search isa HASH
ok 200 - - total correct
ok 201 - all_terms facet isa HASH
ok 202 - - is terms facet
ok 203 - - 3 terms listed
ok 204 - - first is foo
ok 205 - - foo count
ok 206 - bar_facet isa HASH
ok 207 - - is terms facet
ok 208 - - 3 terms listed
ok 209 - - last is baz
ok 210 - - baz count
#
# Testing: search_explain
# -----------------------
ok 211 - Query with explain isa HASH
#
# Testing: search_sort
# --------------------
ok 212 - Query with sort
ok 213 - - reverse sort
ok 214 - - asc
ok 215 - - desc
#
# Testing: search_fields
# ----------------------
ok 216 - Fields query
#
# Testing: search_script_fields
# -----------------------------
ok 217 - Script fields query isa HASH
ok 218 - - script field calculated
#
# Testing: search_highlight
# -------------------------
ok 219 - Highlighting
#
# Testing: search_scroll
# ----------------------
ok 220 - Scroll search
ok 221 - - has scroll ID
ok 222 - - first hit is ID 1
ok 223 - - second hit is ID 2
ok 224 - - next tranche # TODO Sorting when scrolling is broken on server
ok 225 - - first hit is ID 3 # TODO Sorting when scrolling is broken on server
ok 226 - - second hit is ID 4 # TODO Sorting when scrolling is broken on server
ok 227 - - next tranche # TODO Sorting when scrolling is broken on server
not ok 228 - - first hit is ID 5 # TODO Sorting when scrolling is broken on server
# Failed (TODO) test ' - first hit is ID 5'
# at t/request_tests/search_scroll.pl line 33.
# got: '5'
# expected: '3'
not ok 229 - - second hit is ID 6 # TODO Sorting when scrolling is broken on server
# Failed (TODO) test ' - second hit is ID 6'
# at t/request_tests/search_scroll.pl line 34.
# got: '6'
# expected: '4'
#
# Testing: search_indices_boost
# -----------------------------
ok 230 - boost index 1
ok 231 - - index is 1
ok 232 - boost index 2
ok 233 - - index is 2
#
# Testing: search_custom_score
# ----------------------------
ok 234 - Custom score
ok 235 - - total is 29
ok 236 - - max score is 2
ok 237 - - first result scores 2
ok 238 - - first result has high date
ok 239 - - last result scores 1
ok 240 - - last result has low date
#
# Testing: count
# --------------
ok 241 - Count: term
ok 242 - Count: terms
ok 243 - Count: in
ok 244 - Count: range
ok 245 - Count: range, gt/lt
ok 246 - Count: prefix
ok 247 - Count: wildcard
ok 248 - Count: match_all
ok 249 - Count: query_string
ok 250 - Count: bool
ok 251 - Count: dis_max
ok 252 - Count: constant_score
ok 253 - Count: filtered
ok 254 - Count: field
ok 255 - Count: fuzzy
ok 256 - Count: fuzzy_like_this
ok 257 - Count: fuzzy_like_this_field
ok 258 - Count: more_like_this
ok 259 - Count: more_like_this
ok 260 - Count: span queries
not ok 261 - Count: field_masking_span # TODO field_masking_span queries not recognised by server
# Failed (TODO) test 'Count: field_masking_span'
# at t/request_tests/count.pl line 141.
# got: '0'
# expected: '1111'
#
# Testing: more_like_this
# -----------------------
ok 262 - more_like_this
#
# Testing: search_highlight
# -------------------------
ok 263 - Highlighting
#
# Testing: delete_by_query
# ------------------------
ok 264 - Delete by query
ok 265 - - foo deleted
ok 266 - - bar not deleted
ok
All tests successful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment