Commit Graph

3842 Commits

Author SHA1 Message Date
Simon Willnauer 42b20d601f Upgrade to Lucene 4.7.1
* Removed XTermsFilter fixed in LUCENE-5502
 * Switched back to automaton queries that caused failures due to LUCENE-5532
 * Fixed Highlight test that has different results due to LUCENE-5538
2014-04-01 23:50:55 +02:00
Simon Willnauer c88d32150f [TEST] use length-norm as the tie-breaker in BlendedTermQueryTest 2014-04-01 20:36:43 +02:00
Alexander Reelsen 8b8cd26a59 Geo: Allow to parse lat/lon as strings and coerce them
In order to be more failsafe parsing GeoPoints can support
lat/lon as strings and coerce them. Added support and test for this.
2014-04-01 19:09:33 +02:00
javanna f6bbc894cf [TEST] fixed typo in ReproduceInfoPrinter (s/nighly/nightly) 2014-04-01 18:43:14 +02:00
javanna 6ef45a9ae3 [TEST] Print out the `tests.cluster` sys prop if available to be able to reproduce failures when using the external cluster
Relates to #5630
2014-04-01 18:40:43 +02:00
Shay Banon be33c99835 [TEST] Add ability to start nodes in async mode in TestCluster
this will help speed up when starting multiple nodes in a test
closes #5644
2014-04-01 18:01:47 +02:00
javanna 806c4e87fb [TEST] Removed last occurences of cluster_seed, no longer used
Relates to #5233
2014-04-01 17:57:57 +02:00
Simon Willnauer 9c3b6a50a4 [TEST] Add ThreadLeaks protection to ElasticsearchPostingsFormatTest since we keep running clusters around in the JVM 2014-04-01 17:27:58 +02:00
Simon Willnauer 1f4de9cfb5 Enrich exception message if searcher can not be aquired
This commit also moves the log message after the ensureOpen() call
to only log an error if it's really an erro condition.
2014-04-01 17:13:23 +02:00
Simon Willnauer 2a5ffaafcb Throw EngineClosedException if engine is closed
Currently we throw misleading exception in acquireSearcher
if we try to acquire while we are failing the engine. We should
throw an EngineClosedException instead.

Relates to #5633
2014-04-01 17:00:42 +02:00
Simon Willnauer 257eddd8f0 [TEST] Expect all shards to fail if full refresh failed 2014-04-01 17:00:35 +02:00
Simon Willnauer 4da66c4f95 ignore index if it's not in the cluster state and it's in the drop indices set
Closes #5643
2014-04-01 16:02:43 +02:00
Simon Willnauer 98aecee531 [TEST] use assertAcked when creating indices 2014-04-01 16:02:30 +02:00
Robert Muir 24005b4011 add test for ElasticSearchPostingsFormat 2014-04-01 08:50:22 -04:00
Simon Willnauer 268f2c3b12 [TEST] Fix BulkTests#testThatInvalidIndexNamesShouldNotBreakCompleteBulkRequest - randomBoolean() doesn't always return true 2014-04-01 14:38:35 +02:00
Shay Banon c83c72b165 Fail the engine/shard when refresh failed
When refresh failed, it would fail due to a serious issue in the shard (mainly corrupted index). Fail the engine in that cause, which will cause the shard to fail. The reason why its not only on CorruptedIndex failed is that any type of failure seems to be relevant here to fail the shard
closes #5633
2014-04-01 14:32:20 +02:00
Simon Willnauer 71de2bc414 [BUILD] Allow to set tests memory via the commandline 2014-04-01 14:12:52 +02:00
Boaz Leskes 83a013320c Moved BackgroundIndexer to a top level class. Moved waitNumDocs to ElasticsearchIntegrationTestBase.
Update RelocationTests to use the above and unified testPrimaryRelocationWhileIndexing & testReplicaRelocationWhileIndexingRandom into a single randomized test.
2014-04-01 14:12:52 +02:00
Adrien Grand a6a12f97a2 [Test] allow tests to reuse a singel index across tests
This commit speeds up aggregations tests dramatically since they all
rely on the same index structure. Here we can safe a large amout of time
to not recreate the index for each small test.
2014-04-01 14:12:45 +02:00
Boaz Leskes 5bf8b79587 Add a BackgroundIndexer class to RecoveryWhileUnderLoadTests and use it.
Also change the document distribution a bit between the tests
2014-04-01 12:03:57 +02:00
Simon Willnauer e621458a39 [Test] Speedup UpdateTests#testConcurrentUpdateWithRetryOnConflict 2014-04-01 12:03:57 +02:00
Simon Willnauer 6898984307 [Test] Speeup FieldData tests and remove unnecessary @Repeat annotations 2014-04-01 12:03:57 +02:00
Simon Willnauer 6c3ec9e719 [Test] Run intensive suggest tests only if nightly=true 2014-04-01 12:03:57 +02:00
Simon Willnauer e3317f2c6b [Test] Speedup RecoveryWhileUnderLoadTests to run with less documents unless tests.nightly=true 2014-04-01 12:03:57 +02:00
Simon Willnauer e60ca8d8d7 [Test] Speed up RandomAllocationDeciderTests 2014-04-01 12:03:57 +02:00
Shay Banon 6e12584018 [TEST] delegate to the original transport 2014-04-01 11:52:18 +02:00
javanna 38dd501ab5 [TEST] added ExternalTestCluster that allows to run tests against an external cluster
All the ordinary test operations happen based on the ImmutableTestCluster base class and are executed via transport client. Will be used especially for the REST tests once migrated to the standard randomized runner.

Added new httpAddresses method to ImmutableTestCluster to be able to retrieve the http addresses to connect to for the REST tests. Both versions will look inside the cluster to figure out which nodes are available for http calls and their addresses.

The external cluster is used as global cluster if the tests.cluster system property is available. The property needs to contain a comma separated list of available elasticsearch nodes that will be used to connect to the cluster (e.g. localhost:9300,localhost:9301).

Only a subset of the integration tests can currently be run successfully against the external cluster, for more precision the ones that don't modify the cluster layout (don't require cluster() functionalities but rely only on immutableCluster()). Also at least two data nodes are required otherwise the ensureGreen calls cannot succeed.

Closes #5630
2014-04-01 11:45:35 +02:00
Chris Earle 70c089de0a Replaces usage of `StringBuffer` with `StringBuilder` and fixes stray
single quote in the same `PluginInfo#toString()` method.

Closes #5605
2014-04-01 10:40:07 +02:00
Adrien Grand a34378f852 Do not propagate errors from onResult to onFailure.
The way that SearchServiceTransportAction executes actions on a local node
today would propagate exceptions thrown in onResult to onFailure.

Close #5629
2014-04-01 10:02:29 +02:00
Boaz Leskes 350fd8e30b Added trace logging in TransportSearchTypeAction and a delayed verification of test failures in MinDocCountTests.testMinDocCountOnTerms 2014-03-31 23:23:46 +02:00
Shay Banon cc4cae3ba0 Mock Transport: Allow to simulate network failures
An infrastructure that allows to simulate different network topologies failures, including 2 basic ones in failure to send requests, and unresponsive nodes
closes #5631
2014-03-31 22:49:10 +02:00
Boaz Leskes 62b850f52d InternalEngine - back to set dirty=false just *before* a refresh is done
reverting: 5553c383bc
2014-03-31 20:57:58 +02:00
Simon Willnauer c7b1f9946f Discard new cluster state if the clustername doesn't match
Closes #5622
2014-03-31 20:23:49 +02:00
Simon Willnauer df7474b9fc Add cluster_name to cluster_state
Today the clusterstate is not asssociated with the cluster_name which is odd
since it's pretty much it's only valid identifier. Any node can send a cluster
state to another node today even if it's not the same cluster. These situations
can happen rarely during tests or even in the wild by accident.
2014-03-31 20:23:49 +02:00
javanna d570d588a8 [TEST] moved dataNodes method to ImmutableTestCluster base class, replaced cluster().dataNodes() calls with immutableCluster().dataNodes() 2014-03-31 19:09:53 +02:00
javanna bae3203e3b [TEST] replaced cluster().size() calls with immutableCluster().size 2014-03-31 19:07:30 +02:00
javanna 8aea3a2f7d [TEST] fixed TestCluster size() javadocs 2014-03-31 18:34:26 +02:00
javanna 015c21c395 [TEST] move SuggestSearchTests to make use of default number of replicas randomization (based on number of data nodes) 2014-03-31 18:34:25 +02:00
javanna aac1374c76 [TEST] replaced cluster().wipeIndices|wipeTemplates calls with immutableCluster().wipeIndices|wipeTemplates 2014-03-31 18:34:25 +02:00
uboness d6636fc50c Aggregations cleanup
- removed an abstraction layer that handles the values source (consolidated values source with field data source)
- better handling of value parser/formatter in range & histogram aggs
- the buckets key will now be shown by default in range agg
2014-03-31 18:06:48 +02:00
Simon Willnauer 2cd6772329 [TEST] Set minimum_master_nodes for new node as well to make sure all ndoes have the same settings 2014-03-31 18:01:03 +02:00
Boaz Leskes 5553c383bc InternalEngine - only set dirty=false after a refresh happened 2014-03-31 17:39:57 +02:00
Boaz Leskes 1aac41e0d1 InternalEngine - added an assert to verify refresh was performed by lucene 2014-03-31 17:28:38 +02:00
Shay Banon f19f729498 Cleanup Rest Response
simplify rest response class hierarchy, by using BytesReference for content, and handling JSONP internally in the respective channel that sends the response.
Also, handle the future case where bytes might be releasable, when we start to potentially recycle bytes output stream.
2014-03-31 17:24:02 +02:00
Alexander Reelsen 0ff30ade69 ContextSuggester: Adding couple of tests to catch more bugs
A bunch of minor fixes have been included here, especially due
to wrongly parsed mappings. Also using assertions resulted in an
NPE because they were disabled in the distribution.

Closes #5525
2014-03-31 16:16:21 +02:00
Shay Banon f424319f9a Fix visibility in buffered translog
- fix visiblity of last written position in translog
- while there, make sure to properly propagate the exception from sync()
2014-03-31 15:23:23 +02:00
javanna 2e26dc328e [TEST] introduced ImmutableTestCluster abstract base class for TestCluster
The new base class contains all the immutable methods for a cluster, which will be extended by the future ExternalCluster impl that relies on an external cluster and won't be adding nodes etc. but only sending requests to an existing cluster whose layout never changes

Closes #5620
2014-03-31 14:41:05 +02:00
Alexander Reelsen 056ad0a8d3 Bulk API: Ensure that specific failures do not affect whole request
Before a bulk request is executed, missing indices are being created by default.
If this fails, the whole request is failed.

This patch changes the behaviour to not fail the whole request, but rather all
requests using the index where the creation has failed.

Closes #4987
2014-03-31 14:11:28 +02:00
Boaz Leskes 3f37a0ff5c TransportMasterNodeOperationAction: tighter postAdded change check
If a node fails to forward a master node operation to the current master, it will schedule a retry using a listener for cluster state changes. Once the listener is in place (and future changes are guaranteed to be observed) it will double check nothing has change during the addition of the listener. This check has previously been change to use cluster state versions (see: #5499). This is however not reliable solution as master elections (which change the master) do not increment the cluster state version and thus could be missed. This commit changes the check to use reference equality making it stricter.

Closes #5548
2014-03-31 13:57:47 +02:00
Simon Willnauer 5007bf7aa0 [Test] remove timeout from deleteWarmer call with many shards that might just take a while 2014-03-31 13:53:38 +02:00
Kevin Wang 3338750f14 check "store" for binary mapper and check "index_name" for all mappers
closes #5474
2014-03-31 12:44:00 +02:00
Adrien Grand 04c16b7ba5 Fix some warnings reported by Findbugs.
Although high-severity bugs were mostly static variables that were not final,
it also found potential NPEs and bugs like `x ^= x;` or equality checks on
objects that don't share a common interface.

Close #5571
2014-03-31 12:37:04 +02:00
javanna 31ecf1db98 [TEST] Test sending the request body as source parameter with GET method through REST tests
For around 10% of the calls that support the GET method, the request body gets now sent as `source` parameter with GET method (no randomized method in this case).

This way we can find bugs like #5556 (missing support for source param).
2014-03-31 12:36:03 +02:00
Adrien Grand 7f640dbcc6 Refactor common code for unmapped aggregators into `NonCollectingAggregator`.
Our aggregators that are dedicated to unmapped fields all look more or less
the same so this hopefully helps remove some spaghetti code.

Close #5528
2014-03-31 11:46:13 +02:00
Alexander Reelsen fdcc843627 Search template: Fix support for source parameter
If a search template was created using the source parameter, the
content of the parameter was put as source instead of sourceTemplate

Fixes #5556
2014-03-31 11:40:44 +02:00
Martijn van Groningen 3b73209123 An improvement to unicast discovery to also ping nodes the node itself received a ping from.
Also moved the unicast tests all in a single package.

Closes #5508
2014-03-31 10:51:25 +07:00
Simon Willnauer c84f975ff3 [TEST] Wait for shards to allocate before cleaning caches 2014-03-29 21:06:29 +01:00
javanna 5665ea9dad Fixed highlighting inconsistencies between REST and Java api
Exposed HighlightBuilder missing global options in Java API: fragmentSize, numOfFragments, highlightFilter, boundaryMaxScan and boundaryChars
Exposed SearchRequestBuilder missing global options shortcuts: setHighlighterFragmentSize, setHighlighterNumOfFragments, setHighlighterFilter, setHighlighterBoundaryMaxScan, setHighlighterBoundaryChars, setHighlighterFragmenter, setHighlighterPhraseLimit & setHighlighterForceSource

Closes #5281
2014-03-28 18:01:03 +01:00
Kevin Wang 8ab22a53fe fix dynamic_type in dynamic_template
closes #5256
2014-03-28 14:54:55 +01:00
javanna 34e9f8e83b [TEST] Removed skip regex sections as all the runners implemented the feature 2014-03-28 12:19:46 +01:00
Kevin Wang 5a2d195eb7 add human readable start_time and refresh_interval
closes #5280
2014-03-28 12:05:08 +01:00
Kevin Wang ceed22fe00 Add suggest stats
closes #4032
2014-03-28 11:13:54 +01:00
Holger Hoffstätte 0c1b9a6670 Restore streamInput() performance over PagedBytesReference.
Closes #5589
2014-03-28 11:02:53 +01:00
Kevin e78bbbf3ec add CBOR data format support 2014-03-28 20:30:39 +11:00
Simon Willnauer ca8ff571f9 Use only one shard in SuggestSearchTests#testPhraseBoundaryCases to get reliable statistics 2014-03-28 09:54:21 +01:00
Lee Hinman 8fbd1bdd48 Add the `field_value_factor` function to the function_score query
The `field_value_factor` function uses the value of a field in the
document to influence the score.

A query that looks like:
{
  "query": {
    "function_score": {
      "query": {"match": { "body": "foo" }},
      "functions": [
        {
          "field_value_factor": {
            "field": "popularity",
            "factor": 1.1,
            "modifier": "square"
          }
        }
      ],
      "score_mode": "max",
      "boost_mode": "sum"
    }
  }
}

Would have the score modified by:

square(1.1 * doc['popularity'].value)

Closes #5519
2014-03-27 14:29:37 -06:00
Lee Hinman 9ef5136e3d Be less verbose logging ClusterInfoUpdateJob failures
Closes #5222
2014-03-27 13:31:01 -06:00
Shay Banon 680a4ebbea cleanup second static cluster in test
hopefully this will remove the testing infra from failing on hanging to memory
2014-03-27 11:10:08 -07:00
Shay Banon 6fce15beec Tribe: Index level blocks, index conflict settings
allow to configure on the index level which blocks can optionally be applied using tribe.blocks.indices prefix settings.
allow to control what will be done when a conflict is detected on index names coming from several clusters using the tribe.on_conflict setting. Defaults remains "any", but now support also "drop" and "prefer_[tribeName]".
closes #5501
2014-03-27 09:45:20 -07:00
Simon Willnauer 6eb0f3e882 [TEST] Reset global cluster if tearDown failes to prevent subsequent failures 2014-03-27 16:22:22 +01:00
Simon Willnauer 5619ef5951 [JAVA7 Upgrade] Replace try/finally with 2014-03-27 16:00:25 +01:00
Simon Willnauer 1952df982b [JAVA7 Upgrade] Replace explicit type with <> 2014-03-27 15:54:45 +01:00
Simon Willnauer 49d84cb47f [JAVA7 Upgrade] Move to Long.compare 2014-03-27 15:48:12 +01:00
Adrien Grand b5b82626e7 Forbid Math.abs(int/long).
We have had a couple of bugs because of the use of these methods without paying
attention that it might return a negative value when provided with MIN_VALUE.
There is one common and legitimate usage of this method in order to perform
a modulo operation which would always return a positive number. This use-case
has been extracted to MathUtils.mod.

Close #5562
2014-03-27 14:50:43 +01:00
Adrien Grand 800d4624c8 Fix IndexShardRoutingTable's shard randomization to not throw out-of-bounds
exceptions.

Close #5559
2014-03-27 14:33:37 +01:00
Martijn van Groningen d3065acf14 [TEST] Made ttl test more predictable
* Only run the test with one node, to make sure only a single purger thread is running.
* Instead of generating the _timestamp upon indexing in ES, define the _timestamp in the documents.
* Verify the responses from the index requests.
2014-03-27 17:12:05 +07:00
Martijn van Groningen 22b13f5449 Now really fix eager fielddata loading.
Relates to #5557
2014-03-27 13:52:57 +07:00
Martijn van Groningen 5a0c1eb195 Fixed space in licence header. 2014-03-27 12:17:24 +07:00
Martijn van Groningen ec016c735c Fixes a bug when the field has been configured with eager fielddata loading, the fielddata is not being loaded.
Closes #5557
2014-03-27 12:10:05 +07:00
Igor Motov 3ffd0a1dfa Remove deprecated gateways
Closes #5422
2014-03-26 18:10:51 -04:00
javanna c5e6749e12 [TEST] removed leftover ElasticsearchIntegrationTest#randomIndexTemplate
used cluster().randomIndexTemplate instead
2014-03-26 22:59:06 +01:00
javanna 89dd722340 [TEST] Moved wipe* methods, randomIndexTemplate & ensureEstimatedStats from ElasticsearchIntegrationTest to TestCluster
This is the first to make it possible to have a different impl of TestCluster (e.g. based on an external cluster) that has the same methods but a different impl for them (e.g. it might use the REST API to do the same instead of the Java API)

Closes #5542
2014-03-26 17:27:35 +01:00
Simon Willnauer a12a36ef09 Convert TermQuery to PrefixQuery if PHRASE_PREFIX is set
We miss to add a single term to a prefix query if the query in only a
single term.

Closes #5551
2014-03-26 16:22:04 +01:00
Adrien Grand 3fd89bef94 [TEST] Increase logging on MinDocCountTests. 2014-03-26 15:14:48 +01:00
Holger Hoffstätte 280d4bfd28 Assorted fixes for bugs in the PagedBytesReference tests, plus a typo
where the wrong variable was used for a calculation.

Closes #5549
2014-03-26 14:27:16 +01:00
Boaz Leskes 196e3c3602 Capture and set start time in Delete By Query operations
This is important for queries/filters that use `now` in date based queries/filters

Closes #5540
2014-03-26 13:28:45 +01:00
Holger Hoffstätte ab3e22d17c Fix for zero-sized content throwing off toChannelBuffer(). Also
short-circuit writeTo(..) accordingly to avoid unnecessary work.

Fixes #5543
2014-03-26 10:43:47 +01:00
Kevin Wang 374b633a4b add uppercase token filter
closes #5539
2014-03-26 15:07:43 +07:00
Martijn van Groningen 2c65711dd9 [TEST] Added extra test for multi fields with default `include_in_all` settings, in which only the main field should end up in the `_all` field. 2014-03-26 14:34:44 +07:00
Igor Motov 6354bc4861 [TEST] Make sure that there are no relocating shards before taking snapshot
Temporary workaround for #5531
2014-03-25 16:22:29 -04:00
Adrien Grand b0beb3c8e1 Fix PMD warning: don't reassign method parameters. 2014-03-25 18:03:37 +01:00
Holger Hoffstätte cb430bd139 Fix compilation error from last commit. 2014-03-25 17:57:49 +01:00
Boaz Leskes 3d0d3ee082 Added versions 1.1.1, 1.0.3 & 0.90.14 2014-03-25 17:51:48 +01:00
Holger Hoffstätte 424bffca74 Temp. disable use of new PagedBytesReference since it breaks HTTP replies with 0-sized Content-Length 2014-03-25 17:45:32 +01:00
Adrien Grand 431b4024e9 Internally manipulate the terms execution hint as an enum instead of a String.
Close #5530
2014-03-25 16:49:53 +01:00
Holger Hoffstätte 977ed1dc15 PagedBytesReference with a boatload of tests. Passes all new and
existing tests. Non-allocating hashCode/Equals, zero-copy writeTo() and
ChannelBuffer support.

Fix for #5427
2014-03-25 15:18:39 +01:00
Adrien Grand 1c0b6da0ac Allow to disable norms on an existing field.
Close #4813
2014-03-25 14:13:06 +01:00
Martijn van Groningen a48254a04b Set the actual bytes used in circuit breaker back to how it was before loading if the loading wasn't successful.
Closes #5526
2014-03-25 17:50:30 +07:00
Kevin Wang 0ee889fd8b Fix include_in_all for multi field, to not include multi fields into _all field.
Closes #5522
2014-03-25 17:05:55 +07:00
Holger Hoffstätte 89a48014f0 Let ByteArray/BigByteArray.get() indicate whether a byte[] was
materialized.
2014-03-25 10:44:50 +01:00
Adrien Grand badedf657a BytesReference.Helper should never materialize a byte[] array.
The current implementations of BytesReference.Helper.bytesEquals and
bytesHashCode materialize a byte[] when passed an instance that returns `false`
in `hasArray()`. They should instead do a byte-by-byte comparison/hashcode
computation without materializing the array.

Close #5517
2014-03-25 09:50:33 +01:00
Simon Willnauer 8a60dacb3d [TEST] Don't pass possibly oversized array with 0 padding to SearchRequestBuilder#setFacet(byte[]) 2014-03-24 21:25:02 +01:00
Simon Willnauer 76e595278a Fix JsonXContentGenerator to write comma after rawWrite if needed 2014-03-24 19:46:01 +01:00
Shay Banon 333e7df3bc fix potential NPE, throw failure only if exists 2014-03-24 10:21:54 -07:00
Simon Willnauer 8709427b4a Randomize XContentType for requests
The used XContentType is static and should be randomized per test.

Closes #5515
2014-03-24 18:07:24 +01:00
Simon Willnauer c2e6aa273d Use build-in function to write field name in JsonXContentGenerator#writeRawField
The #writeRawField method forcefully writes a `,` spearator expecting a raw field
to never start as the first value in an object.

Closes #5514
2014-03-24 14:32:32 +01:00
Kevin Wang 21e2dfb6b1 Fix incorrect return impl in SmileXContent.createParser.
Close #5510
2014-03-24 12:22:05 +01:00
Kevin 1496b03458 Merge null_value for boolean field and remove include_in_all for boolean field in doc
Close #5502
2014-03-24 11:00:57 +01:00
Simon Willnauer 6f6dd90d1a [TEST] Fix rounding error problems in FuzzinessTests 2014-03-24 10:59:12 +01:00
Kevin Wang bfd3236378 Merge GeoPoint specific mapping properties
Close #5505
2014-03-24 09:30:55 +01:00
Boaz Leskes c650ee47f3 TransportMasterNodeOperationAction: retry operation if cluster state version changed while adding a ClusterStateListener
TransportMasterNodeOperationAction forwards incoming requests to the currently known master node. If that fails due to a connection error, a cluster state listener will be added in order to try again when a new master is elected. After the listener is in place, a check was made to see if the master has change *while* the listener was being added so that change will not be missed. The check was not enough as it may be that the same master was re-elected (for example, a network hick up) and thus test will fail even though the re-ellection event was missed. In these cases, the request would timeout unjustly. This commit changes this test to be  more strict and retry if the cluster state version changed during the addition of the listener.

Closes #5499
2014-03-24 09:03:32 +01:00
Simon Willnauer 034ce75250 [TEST] ensure that we don't fail if all shards fail due to no replicas and low number of shards 2014-03-23 21:42:07 +01:00
Simon Willnauer 6962d4f948 [TEST] Add mapping to ensure all nodes / shards parse a numeric field 2014-03-23 21:29:10 +01:00
Simon Willnauer 702a0c4948 [TEST] Disable wildcard query in testFixAOBEIfTopChildrenIsWrappedInMusNotClause for now 2014-03-23 15:58:48 +01:00
Boaz Leskes c74f1de3a6 Nodes who are not currently master do not update the ElectMasterService when dynamically setting min_master_nodes
When updating the min_master_nodes setting via the Cluster Settings API, the change is propagated to all nodes. The current master node also updates the ElectMasterService and validates that is still sees enough master eligible nodes and that it's election is still valid. Other master eligible nodes do not go through this validation (good) but also didn't update the ElectMasterService with the new settings. The result is that if the current master goes away, the next election will not be done with the latest setting.

Note - min_master_node set in the elasticsearch.yml file are processed correctly

Closes #5494
2014-03-22 21:33:52 +01:00
Robert Muir 5babf59813 Update to forbidden-apis 1.4.1
Closes #5492
2014-03-22 15:00:19 -04:00
Simon Willnauer 699044bce9 [TEST] Assert search response in MinDocCountTests#testMinDocCountOnTerms 2014-03-22 19:31:19 +01:00
Simon Willnauer 127371022d [TEST] Make SearchWhileRelocatingTests to handle known limitations gracefully 2014-03-22 19:13:24 +01:00
Simon Willnauer 5194521097 [Test] Run after checks even if cluster scope is == TEST 2014-03-21 16:13:00 +01:00
Simon Willnauer 2398bb4f1c Close Directory / Store once all resources have been released
Currently we close the store and therefor the underlying directory
when the engine / shard is closed ie. during relocation etc. We also
just close it while there are still searches going on and/or we are
recovering from it. The recoveries might fail which is ok but searches
etc. will be working like pending fetch phases.

The contract of the Directory doesn't prevent to read from a stream
that was already opened before the Directory was closed but from a
system boundary perspective and from lifecycles that we test it seems
to be the right thing to do to wait until all resources are released.

Additionally it will also help to make sure everything is closed
properly before directories are closed itself.

Note: this commit adds Object#wait & Object@#notify/All to forbidden APIs

Closes #5432
2014-03-21 15:02:38 +01:00
Martijn van Groningen 947c5f6920 Improved regular scroll api by using IndexSearch#searchAfter instead of regular search methods which rely on `from` for pagination.
This prevents the creation of priority queues of `from + size`, instead the size of the priority queue will always be equal to `size`.

Closes #4940
2014-03-21 13:50:50 +07:00
Simon Willnauer 7d7f2d728e [TEST] Add a test that ensures Version#CURRENT is actually the latest version 2014-03-20 21:09:58 +01:00
Simon Willnauer 9cd3e850af Add simple escape method for special characters to template query
The default mustache engine was using HTML escaping which breaks queries
if used with JSON etc. This commit adds escaping for:

```
\b  Backspace (ascii code 08)
\f  Form feed (ascii code 0C)
\n  New line
\r  Carriage return
\t  Tab
\v  Vertical tab
\"  Double quote
\\  Backslash
```

Closes #5473
2014-03-20 18:48:14 +01:00
Simon Willnauer b11d4a5871 Add new / missing version constants 2014-03-20 18:44:15 +01:00
Andrew Selden 89e45fde9c Recovery API
Adds a new API endpoint at /_recovery as well as to the Java API. The
recovery API allows one to see the recovery status of all shards in the
cluster. It will report on percent complete, recovery type, and which
files are copied.

Closes #4637
2014-03-20 10:13:30 -07:00
Alexander Reelsen 8f6e1d4720 Query Templates: Adding dedicated /_search/template endpoint
In order to simplify query template execution an own endpoint has been added

Closes #5353
2014-03-20 17:43:40 +01:00
uboness 7d6ad8d91c Added extended_bounds support for date_/histogram aggs
By default the date_/histogram returns all the buckets within the range of the data itself, that is, the documents with the smallest values (on which with histogram) will determine the min bucket (the bucket with the smallest key) and the documents with the highest values will determine the max bucket (the bucket with the highest key). Often, when when requesting empty buckets (min_doc_count : 0), this causes a confusion, specifically, when the data is also filtered.

To understand why, let's look at an example:

Lets say the you're filtering your request to get all docs from the last month, and in the date_histogram aggs you'd like to slice the data per day. You also specify min_doc_count:0 so that you'd still get empty buckets for those days to which no document belongs. By default, if the first document that fall in this last month also happen to fall on the first day of the **second week** of the month, the date_histogram will **not** return empty buckets for all those days prior to that second week. The reason for that is that by default the histogram aggregations only start building buckets when they encounter documents (hence, missing on all the days of the first week in our example).

With extended_bounds, you now can "force" the histogram aggregations to start building buckets on a specific min values and also keep on building buckets up to a max value (even if there are no documents anymore). Using extended_bounds only makes sense when min_doc_count is 0 (the empty buckets will never be returned if the min_doc_count is greater than 0).

Note that (as the name suggest) extended_bounds is **not** filtering buckets. Meaning, if the min bounds is higher than the values extracted from the documents, the documents will still dictate what the min bucket will be (and the same goes to the extended_bounds.max and the max bucket). For filtering buckets, one should nest the histogram agg under a range filter agg with the appropriate min/max.

Closes #5224
2014-03-20 14:48:27 +01:00
uboness 07af39364e Changed the DateHistogram.Bucket to return the date key in UTC timezone
Closes #5477
2014-03-20 13:30:08 +01:00
Shay Banon 6a2bb9a35e clean the query parse context after usage
that will make sure we don't have any parsers lying around that are no longer used
2014-03-20 13:11:15 +01:00
Simon Willnauer 047119d92e Add BoolFilterBuilder#hasClauses to be consitent with BoolQueryBuilder
Closes #5472
2014-03-20 13:05:04 +01:00
Simon Willnauer bd003fe5b6 [TEST] add @Slow annotations to bad apples 2014-03-20 12:58:28 +01:00
Britta Weber be3c5b44e0 category type should be called "category" instead of "field" in context suggester
Change according to documentation.
2014-03-20 12:25:45 +01:00
Florian Schilling c0a092aa92 [Doc] Updated docs for distance scripting
Updated docs for distance scripting and
added missing geohash distance functions
Closes #5397
2014-03-20 12:18:25 +01:00
markharwood 0cd184ef3c Fix for Jenkins advice on SignificantTermsAggregatorFactory, changing a small switch statement to an if-else 2014-03-20 11:02:06 +00:00
David Smiley 644fdfc4aa Upgrade to Spatial4j 0.4.1 and JTS 1.13
Fixes #5279
2014-03-20 11:17:51 +01:00
Simon Willnauer 34077e3121 [TEST] remove time upperbound from test - only for testing 2014-03-20 11:12:35 +01:00
Clinton Gormley 96655d2505 PUT /_aliases should accept a numeric routing value
Also added REST tests for setting index/search/routing
via the PUT /_aliases endpoint

Fixes #5465
2014-03-20 10:38:32 +01:00
Boaz Leskes a3f57c176e [Test] IndicesLifecycleListenerTests - added busy waiting for expected results (and improved error message)
The test currently uses ensureGreen to guaranty all shard allocations has happened. This only guaranties it from the cluster perspective and in some cases the nodes are not fast enough to implement the changes (which is what the test is about).
2014-03-20 10:34:44 +01:00
Simon Willnauer adfa82b2ed Allow iteration over MultiGetRequest#Item instances
Closes #3061
2014-03-20 10:24:12 +01:00
Adrien Grand ecdcc2df92 Fix cardinality memory-usage considerations.
Default precision was computed based on the number of MULTI_BUCKET parents
instead of PER_BUCKET.

The ordinals-based execution mode was almost always used although ordinals
might have non-negligible memory usage compared to the counters.

Close #5452
2014-03-20 10:02:40 +01:00
Martijn van Groningen 85c3c6fe62 [TEST] Disable wildcard query in testDfsSearchType for now 2014-03-20 14:56:25 +07:00
Andrew Raines 37b59d196b Remove shard-level info from _cat/segments and add pri/rep and ip address to segments
Also fix typo

Closes #4711
2014-03-19 22:56:06 -05:00
colings86 a7b3fdf3bf Added segments action to _cat API
Currently displays the same information as the _segments API
2014-03-19 22:56:06 -05:00
Florian Schilling 689fd15d78 Add exceptions to `GeoPointFieldMapper` when parsing `geo_point` object
* moved `geo_point` parsing to GeoUtils
* cleaned up `gzipped.json` for bulktest
* merged `GeoPointFieldMapper` and `GeoPoint` parsing methods

Closes #5390
2014-03-19 17:30:49 +01:00
markharwood 12d1bf8485 Significant_terms agg only creates term frequency cache when necessary and uses new TermsEnum wrapper to cache frequencies. Long and String-based aggs no longer need to pass an IndexReader as parameter when looking up frequencies of terms.
Closes #5459
2014-03-19 15:49:23 +00:00
Shay Banon d24600830b Use BytesReference to write to translog files
Instead of using byte arrays, pass the BytesReference to the actual translog file, and use the new copyTo(channel) method to write. This will improve by not potentially having to convert the data to a byte array
closes #5463
2014-03-19 14:12:42 +01:00
Martijn van Groningen 9001874a47 Invoke super.clone() instead of creating a new instance in the clone methods. 2014-03-19 11:12:14 +07:00
Boaz Leskes 7380a0a65a [Test] RecoveryWhileUnderLoadTests: smarter waiting for background indexers as it sometimes times out. 2014-03-19 00:12:03 +01:00
Benjamin Devèze f38d6f8a1b Minor improvements to Table class and add tests 2014-03-18 17:23:07 -05:00
Shay Banon 1f15c1e7de BytesReference usage to properly work when hasArray is not available
fix spelling in comment, + remove overcautious assert
2014-03-18 21:06:04 +01:00