Commit Graph

5860 Commits

Author SHA1 Message Date
Alex Ksikes dda33155d6 Indices API: Fix wrong search stats groups
This provides a fix to issue #7644. A new Stats object must be created, and
not a reference to the retrieved stats, before we can add stats to it.
Otherwise, we would keep on adding to the same object on subsequent calls to
IndicesStatsResponse#getPrimaries() or IndicesStatsResponse#getTotal().

Closes #7644 and #8950
2014-12-16 14:31:41 +01:00
Lee Hinman 54f2eae4d8 [TEST] Remove "compressed" field data from numeric formats
The "compressed" format was removed, so this caused warnings in the log
like:

```
[WARN ][index.fielddata          ] [node_0] [test] failed to find format
[compressed] for field [test-num], will use default
```
2014-12-16 12:38:59 +01:00
Lee Hinman 63ee24982f [TEST] Call .cleanUp() on field data cache
Now that we do not automatically call .cleanUp() when clearing the field
data cache, we need to call it after the cache clear in
RandomExceptionCircuitBreakerTests
2014-12-16 12:38:47 +01:00
Simon Willnauer af64a02ed1 Add toString() to IndexShardGateway 2014-12-15 22:53:58 +01:00
Simon Willnauer a834cc0e0f Shutdown indices service last
We do wait for shards to be closed in IndicesService for 30 second.
Yet, if somebody holds on to a store reference ie. an open scroll request
the 30 seconds time-out and node shutdown takes very long. We should
release all other resources first before we shutdown IndicesService.

Closes #8940
2014-12-15 22:43:37 +01:00
Ryan Ernst 37287284e6 Settings: Remove `mapping.date.round_ceil` setting for date math parsing
The setting `mapping.date.round_ceil` (and the undocumented setting
`index.mapping.date.parse_upper_inclusive`) affect how date ranges using
`lte` are parsed.  In #8556 the semantics of date rounding were
solidified, eliminating the need to have different parsing functions
whether the date is inclusive or exclusive.

This change removes these legacy settings and improves the tests
for the date math parser (now at 100% coverage!). It also removes the
unnecessary function `DateMathParser.parseTimeZone` for which
the existing `DateTimeZone.forID` handles all use cases.

Any user previously using these settings can refer to the changed
semantics and change their query accordingly. This is a breaking change
because even dates without datemath previously used the different
parsing functions depending on context.

closes #8598
closes #8889
2014-12-15 13:13:45 -08:00
Lee Hinman 8fbf45ef2b [TEST] Make parent breaker check less strict
In cases of heavy contention, it's possible for more than 2 threads
to race to a circuit breaking exception.

Essentially this means that if we have 3 threads all trying to add 3 and
simultaneously cause a circuit breaking exception (due to retry), when
adjusting after circuit breaking we can "rewind" past what this test
expects the child breaker to be at.

This adds leeway into the check, where it's okay to be within
NUM_THREADS from the parentLimit, because each thread should only add 1
to the breaker at a time.
2014-12-15 17:06:21 +01:00
Simon Willnauer 3bba45289e Remove unused code 2014-12-15 16:26:48 +01:00
Simon Willnauer 1247774ff1 Remove Gateway abstraction
We only have a single gatweway since es 1.3. There is no need to keep all
these abstractsion and nested packages. We can fold most of it into simpler
structures.
2014-12-15 15:53:02 +01:00
Lee Hinman a8fa650ee6 [CORE] Remove IndexEngine
IndexEngine was an abstraction where we had index-level engines (instead
of shard-level) that could store meta information about the index. It
was never actually used by Elasticsearch, and only there for plugins.

This removes it, because it is a confusing abstraction and not needed,
no plugins should be implementing their own IndexEngines.
2014-12-15 14:30:44 +01:00
Boaz Leskes d62bf5f67f Discovery: concurrent node failures can cause unneeded cluster state publishing
When a node fails (or closes), the master processes the network disconnect event and removes the node from the cluster state. If multiple nodes fail (or shut down) in rapid succession, we process the events and remove the nodes one by one. During this process, the intermediate cluster states may cause the node fault detection to signal the failure of nodes that are not yet removed from the cluster state. While this is fine, it currently causes unneeded reroutes and cluster state publishing, which can be cumbersome in big clusters.

Closes #8804
Closes #8933
2014-12-15 14:01:25 +01:00
Lee Hinman 9b18c44b67 Default _cat APIs to verbose
`?v=false` can be used if the headers are not desired.

Resolves #8922

Fixes #8927
2014-12-15 12:51:59 +00:00
Simon Willnauer e47b753617 [SEARCH] close active contexts on SearchService#close()
When we close a node all pending / active search requests need to be
cleared otherwise a node will wait up to 30 sec for shutdown sicne there
could be open scroll requests. This behavior was introduces in 1.5 such that
versions <= 1.4.x are not affected.

Closes #8940
2014-12-15 09:41:31 +01:00
Boaz Leskes a63a055f63 Test: missing {} from log command in indexRandom 2014-12-13 17:24:46 +01:00
Boaz Leskes 22da975e34 Test: reduce join timeout in testFullRollingRestart
Occasionally a the join thread successfully connected to a just closed node and which causes the subsequent join request to time out. It's default timeout 60s throws the test off when it waits for a cluster to form.
2014-12-13 13:05:04 +01:00
Michael McCandless ae11c4654b Core: use compound file by default for merged segments < 10% of index size
Change Elasticsearch to use Lucene's defaults, to reduce file descriptor count.

Closes #8934

Closes #8919
2014-12-12 15:51:37 -05:00
Britta Weber 60e805cc1f [TEST] use ensureYellow() 2014-12-12 18:07:14 +01:00
Britta Weber 185521be4b [TEST] wait for yellow before searching 2014-12-12 17:34:07 +01:00
Britta Weber 2dc9392a34 [TEST] get trace logs for search packages 2014-12-12 17:06:16 +01:00
Lee Hinman 6bf18056b0 [CORE] Remove explicit .cleanUp() on cache clear
Calling cache.cleanUp() is kind of like calling System.gc(), meaning
that we should never have (non-test) things that rely on this
functionality.

For the field data and filter cache, we already have a periodic process
that runs this .cleanUp(), so there is no need to block index
closing/clearing on it. Instead, we can clean the field data cache in
InternalTestCluster before we check the circuit breaker.

This can help tests that time out because cleaning the cache is taking
too long
2014-12-12 13:24:45 +01:00
Simon Willnauer 42d9a57d0c [TEST] Wait for yellow before verifying - sometimes the shard is not even started 2014-12-12 12:40:34 +01:00
Simon Willnauer b857a1f635 Remove circular dependency between IndicesService and IndicesStore 2014-12-12 12:25:25 +01:00
Simon Willnauer 498331d16f [TEST] Remove random templates for ConcurrentDynamicTemplateTests 2014-12-12 12:18:58 +01:00
Michael McCandless c9d63d3482 Core: don't block shard stats when phase 3 of recovery is running
Today, shard stats are blocked while phase 3 of recovery (replay xlog)
is running; this change removes the engine readLock from shard stats
so it's not blocked.

Closes #8910
2014-12-12 05:18:25 -05:00
Simon Willnauer 6dacf61dfc [TEST] Add test to ensure master is not prone to #8917 2014-12-12 10:59:11 +01:00
Simon Willnauer 7b82660ffc [TEST] Remove debug leftover 2014-12-12 09:29:33 +01:00
Simon Willnauer dac520170f [TEST] Close the node env after test is done 2014-12-11 21:24:15 +01:00
Simon Willnauer 3877dc618d Remove some Internal* abstractions
We have lots of boilerplate code that is unnecessarily abstracting
services ie InternalIndexShard and IndexShard or InternalIndexService and
IndexService. It's enough to have concrete classes for these core classes.

Closes #8904
2014-12-11 17:31:01 +01:00
Simon Willnauer 59534391da [GATEWAY] Cleanup LocalGatewayShardsState
This commit tries to cleanup LocalGatewayShardsState to be more efficient
and easier to understand.
2014-12-11 17:17:50 +01:00
Alexander Reelsen 544ef8cb17 Packaging: Add java7/8 java-package paths to debian init script
If you use the java-package tool to create java packages, those
paths also should be added to the debian init script.

Also updated the docs, that it is ok to install java8.

Closes #7383
2014-12-11 16:15:00 +01:00
Peter Fabian Mitchell b2bab05c29 HTTP: Add 'http.publish_port' setting to the HTTP module
This change adds a 'http.publish_port' setting to the HTTP module to configure
the port which HTTP clients should use when communicating with the node. This
is useful when running on a bridged network interface or when running behind
a proxy or firewall.

Closes #8807
Closes #8137
2014-12-11 16:10:07 +01:00
Simon Willnauer 123fb2f5db [SCRIPT] ScriptService can deadlock entire nodes if script index is recovering
we currently have operationThreaded set to false when indexing a script. This setting
means that if we are executing the operation locally that we don't spawn a new thread for
it althought incoming thread in this case is the network thread. Now sicne we are indexing here
the engine is currently recovering which sometimes locks the engine for finalization blocks on
a network call waiting for the recovery target to come back the internal lock in engine will never be
released since we are waiting with our network thread for it to be released.
2014-12-11 16:04:25 +01:00
Simon Willnauer ba881a9b58 [ENGINE] Remove engine related command classes
Todaqy we pass structs to the engine to call optimize / refresh and flush.
This commit cleans up this logic to reduce complexity in the engine.
2014-12-11 15:47:24 +01:00
Jun Ohtani 80bd69811d Mappings: Fix Get field mapping api with pretty flag
Closes #6552
2014-12-11 22:56:54 +09:00
Michael McCandless 084d25cdbd Test: create private store for these test cases 2014-12-11 05:25:44 -05:00
Robert Muir a2ffe494ae [core] add best_compression option for Lucene 5.0
Upgrades lucene to latest, and supports the BEST_COMPRESSION parameter
now supported (with backwards compatibility, etc) in Lucene.
This option uses deflate, tuned for highly compressible data.

index.codec::
The default value compresses stored data with LZ4 compression, but
this can be set to best_compression for a higher compression ratio,
at the expense of slower stored fields performance.

IMO its safest to implement as a named codec here, because ES already
has logic to handle this correctly, and because its unrealistic to have
a plethora of options to Lucene's default codec... we are practically
limited in Lucene to what we can support with back compat, so I don't
think we should overengineer this and add additional unnecessary plumbing.

See also:
https://issues.apache.org/jira/browse/LUCENE-5914
https://issues.apache.org/jira/browse/LUCENE-6089
https://issues.apache.org/jira/browse/LUCENE-6090
https://issues.apache.org/jira/browse/LUCENE-6100

Closes #8863
2014-12-10 22:13:09 -05:00
Nicholas Knize aa644e3ad7 [GEO] Fix for NPE enclosed in SearchParseException for a "geo_shape" filter or query
This fix adds better error handling for parsing multipoint, linestring, and polygon GeoJSONs.  Current logic throws a NPE when parsing a multipoint, linestring, or polygon that does not comply with the GeoJSON specification. That is, if a user provides a single coordinate instead of an array of coordinates, or array of linestrings, the ShapeParser throws a NPE wrapped in a SearchParseException instead of a more useful error message.

Closes #8432
2014-12-10 16:42:36 -06:00
Simon Willnauer f308049a90 [ENGINE] Fix updates dynamic settings in InternalEngineHolder
After the refactoring in #8784 some settings didn't get passed to the
actual engine and there exists a race if the settings are updated while
the engine is started such that the actual starting engine doesn't see
the latest settings. This commit fixes the concurrency issue as well as
adds tests to ensure the settings are reflected.
2014-12-10 23:07:13 +01:00
Simon Willnauer 788d7cb451 [TEST] Reset test logger to default level 2014-12-10 22:47:03 +01:00
Britta Weber 57b77c6907 [TEST] wait for yellow to avoid searching while relocating
After upgrading shard might start relocating again. If there are no
replicas the cluster state of a node might not be up to data for
a few miliseconds and direct a search request to a node that does not
have the shard anymore. This result in the following test failures:

1> java.lang.AssertionError: Count is 99 but 101 was expected.  Total shards: 13 Successful shards: 12 & 0 shard failures:
1>     __randomizedtesting.SeedInfo.seed([1932F73B458703CA:6F4FAD3DAC55591C]:0)
1>     [...org.junit.*]
1>     org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount(ElasticsearchAssertions.java:184)
1>     org.elasticsearch.bwcompat.BasicBackwardsCompatibilityTest.testIndexRollingUpgrade(BasicBackwardsCompatibilityTest.java:358)

Waiting for relocation finished should fix this.
2014-12-10 17:46:32 +01:00
Simon Willnauer 905dc90eec [CORE] Drop support for state written pre 0.90
Today we have several upgrade methods that can read state written
pre 0.90 or even pre 0.19. Version 2.0 should not support these state
formats. Users of these version should upgrade to a 1.x or 0.90.x version
first.

Closes #8850
2014-12-10 16:59:07 +01:00
Simon Willnauer e5a7eaff22 [TEST] Use private store for a test private engine
The test was using the same store as the suite level engine which caused
problems with write locks in some cases.

Closes #8880
2014-12-10 16:56:52 +01:00
Michael McCandless 624a4b87bf Core: put []'s around the values in the slow-merge log message 2014-12-10 09:22:28 -05:00
Simon Willnauer 3b585e5a5e Add more trace logging to gateway translog recovery 2014-12-10 11:10:32 +01:00
Simon Willnauer da11bf4c1d Use Lucene version string in main rest action
This commit removes the deprecated constant for the main
version and uses the real lucene version we are running instead.
Behind the scenes the same value was used and is now obsolet.
2014-12-10 10:40:58 +01:00
Michael McCandless de75517357 Core: also log byte size and doc count when we log slow merges
Closes #8855

Closes #8853
2014-12-09 18:16:07 -05:00
Simon Willnauer 127255f62e [TEST] Restore test logging level after test is done 2014-12-09 23:31:24 +01:00
javanna 796ebcb88b [TEST] LoggingListener to restore the initial logger levels after any modification
Modifications to LoggingListener pushed with #8820 caused the original logger levels not to be reset after modifications, as the new state was saved for restore instead of the previous one.

 Added unit tests for LoggingListener as well.

Closes #8845
2014-12-09 14:26:13 +01:00
Simon Willnauer 8ffe8e0259 [TEST] compare strings and strings - leftover from Path API refactoring 2014-12-09 14:22:15 +01:00
Robert Muir 39186edc86 Ban java.io.File in tests.
Restrict use of java.io.File to 5 methods (excluded), but otherwise ban.
This is a prerequisite to do any mocking here.

I don't try to do any heavy cleanup on these tests, I am not familiar with them.
So this is mostly a rote straightforward conversion.

Closes #8836
2014-12-09 05:57:48 -05:00
Simon Willnauer c0d50f2a80 [TEST] Beef up InternalEngineTest and remove bogus timeouts 2014-12-09 09:31:33 +01:00
Ryan Ernst 0c8f5ac129 Tests: Additional test for memory stats api. 2014-12-08 15:43:31 -08:00
Ryan Ernst fde32cc599 Stats: Add more fine grained memory stats from Lucene segment reader.
This is a start to exposing memory stats improvements from Lucene 5.0.
This adds the following categories of Lucene index pieces to index stats:
* Terms
* Stored fields
* Term Vectors
* Norms
* Doc values
2014-12-08 15:29:43 -08:00
Robert Muir 150c2203ac Add test that ES filterreader getCoreCacheKey() behaves correctly.
Closes #8831.
2014-12-08 17:58:27 -05:00
Robert Muir 380e47dbf2 fix cache key methods on leaf reader 2014-12-08 15:28:53 -05:00
Michael McCandless b0b96af746 Test: fix this test to work in IntelliJ 2014-12-08 15:11:06 -05:00
Simon Willnauer b28fc1afa5 [ENGINE] Add engine lifecycle store reference to EngineHolder
This commit add the engines reference to the store out of the actual
implementation into the hodler since the holder manages the actual lifcycle.
Engine internal references like per searcher or per recovery are kept inside
the actual implemenation since the have a different lifecycle.
2014-12-08 21:07:12 +01:00
tlrx 31a77185a6 Merge branch 'fix/plugins-loading' 2014-12-08 17:15:06 +01:00
tlrx 97ec8f94ae Plugins: Plugin failed to load since #8666
The method Path.endsWith(String s) doesn't work exactly the same way as String.endsWith() (see http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#endsWith(java.nio.file.Path)). This blocks the loading of plugins.
2014-12-08 17:13:39 +01:00
Simon Willnauer 84066128ed [TEST] Pass class level test logging to external nodes
This commit passes the test logging annotation from the class
level to the external nodes as well.

Closes #8552
2014-12-08 13:25:03 +01:00
Boaz Leskes 83bb65a020 Internal: allow InternalEngine to be stopped and started
Once the current engine is started you can only close it once. Once closed the engine cannot be started again. This commit adds a stop method which signals the engine to free it's resources but in a way that allows restarting.

This is done by introducing InternalEngineHolder which is a wrapper around InternalEngine. This allows to add the stop() method without adding complexity the engine implementation. InternalEngineHolder also serves an entry point for listeners (incoming and outgoing) to other ES components, which removes the needs add/remove them if the engine is stopped.

Closes #8784
2014-12-08 12:40:38 +01:00
Lee Hinman 83fa7bfaba [TEST] Add unit tests for DiskThresholdDecider settings 2014-12-08 12:14:09 +01:00
Simon Willnauer 8d7ce3c558 [STORE] Expose ShardId via LeafReader rather than Direcotry API
Today we try to fetch a shard Id for a given IndexReader / LeafReader
by walking it's tree until the lucene internal SegmentReader and then
casting the directory into a StoreDirecotory. This class is fully internal
to Elasticsearch and should not be exposed outside of the Store.

This commit makes StoreDirectory a private inner class and adds dedicated
ElasticsearchDirectoryReader / ElasticserachLeafReader exposing a ShardId
getter to obtain information about the shard the index / segment belogs to.

These classes can be used to expose other segment specific information in
the future more easily.
2014-12-08 12:10:28 +01:00
Simon Willnauer a43259eba4 Add more trace loggin to LocalIndexShardGateway.java 2014-12-08 12:07:16 +01:00
tlrx a046ee756d Scripting: Add explicit error message when script_score script returns NaN
When a scoring script returns not a number, the current message is confusing (IllegalArgumentException[docID must be >= 0 and < maxDoc=3 (got docID=2147483647)]). This commit adds the error message ScriptException[script score function returns a wrong score: NaN].

Closes #2426
2014-12-08 10:14:01 +01:00
Alexander Reelsen 7b64a5c2c8 Packaging: Check if proc file exists before calling sysctl
The packaged init scripts could return an error, if the file
/proc/sys/vm/max_map_count was not existing and we still called
sysctl.

This is primarly to prevent confusing error messages when elasticsearch
is started under virtualized environments without a proc file system.

Closes #4978
2014-12-08 09:56:14 +01:00
Boaz Leskes 2bc48a4806 Tests: move RecoverAfterNodesTests to org.elasticsearch.gateway.local and increase BLOCK_WAIT_TIMEOUT to 10s
The tests were still in org.elasticsearch.gateway.none but the none gateway was removed.
2014-12-07 22:10:11 +01:00
Simon Willnauer 3cdf266d4d [ALLOCATION] Speed-up disk-threshold decider
Instead of iterating all shards of all indices to get all relocating
shards for a given node we can just use the RoutingNode#shardsWithState
method and fetch all INITIALIZING / RELOCATING shards and check if they
are relocating. This operation is much faster and uses pre-build
data-structures.

Relates to #6372
2014-12-06 22:03:37 +01:00
Patrick Koenig 00275ac1d6 Clarify InternalIndexShard callbacks
This commit changes internal callback to be clear
about when they are called and also provide the
exception that was potentially thrown as a callback argument.

Closes #5945
2014-12-05 23:55:32 +01:00
Igor Motov 0b024ad2f3 Snapshot/Restore: switch to write once mode for snapshot metadata files
This commit removes creation of in-progress snapshot file and makes creation of the final snapshot file atomic.

Fixes #8696
2014-12-05 12:39:24 -05:00
Simon Willnauer 0bab17ffde [TEST] wait unitl all machines joined the cluster 2014-12-05 18:12:00 +01:00
Lee Hinman d32f1a8ad0 [TESTS] Log what the _default_ template is in ElasticsearchIntegrationTest 2014-12-05 14:45:24 +01:00
Lee Hinman caa5af4bf6 [TESTS] Use a _default_ template to load field data lazily
Previously it was possible for the field data clearing in this test to
take too long, causing the test to time out.

This also switches to using `scaledRandomIntBetween` for the number of
fields.
2014-12-05 14:45:17 +01:00
Thilo Fromm 3d03c39ae6 Packaging: Make ES user own plugins dir, remove on uninstall
This change will chown /usr/share/elasticsearch/plugins to the elasticsearch
user (the directory was formerly owned by root). This enables the ES user to
manage plugins.

Also, /usr/share/elasticsearch/plugins is now removed when the elasticsearch
package is un-installed. Previously it was left lying there.

Closes #8732

Signed-off-by: Thilo Fromm <github@thilo-fromm.de>
2014-12-05 14:25:15 +01:00
Thilo Fromm 98d18c4bd9 deb: add systemd service config for upcoming Jessie
This change adds a systemd service configuration file, and adds systemd logic
to installation and de-installation scripts. The upcoming Debian 8 "Jessie"
release will use systemd.

fixes #8943

Signed-off-by: Thilo Fromm <github@thilo-fromm.de>
2014-12-05 12:25:48 +01:00
Louis Sautier 6c2abcc754 Debian package: Prevent init script from returning when the service isn't actually started.
Close #6909
2014-12-05 10:26:31 +01:00
Boaz Leskes 72155311f0 Gateway: GatewayService should register cluster state listener before checking for current state
At the moment we may miss a state change and fail to recover on time.

Closes #8789
2014-12-05 10:22:20 +01:00
John Michael Luy 27724bef6a Typo in error message with too few points for geo polygon filter.
Closes #8767
2014-12-04 20:20:21 +01:00
Simon Willnauer b8687163c4 [TEST] produce valid symlinks in tests 2014-12-04 17:02:38 +01:00
Martijn van Groningen 7ac713aedc Core: surgically removed slow scroll, because master (2.0) requires full cluster restart coming from previous versions. 2014-12-04 15:56:03 +01:00
Simon Willnauer 8b5bc2643e [Store] Only fail recovery if files are inconsistent
the recovery diff can return file in the `different` category
since it's conservative if it can't tell if the files are the same.
Yet, the cleanup code only needs to ensure both ends of the recovery
are consistent. If we have a very old segments_N file no checksum is present
but for the delete files they might be such that the segments file passes
the consistency check but the .del file doesn't sicne it's in-fact the same
but this check was missing in the last commit.
2014-12-04 15:48:40 +01:00
javanna ad004072bb Internal: remove optional original indices
Original indices are optional in ShardDeleteByQueryRequest only for backwards compatibility, see #7406. We can remove this in master since 2.0 will require a full cluster restart.

Closes #8777
2014-12-04 14:25:46 +01:00
javanna 95c2d844a9 Internal: remove some more bwc code
Some more code that was left for backwards compatibility can now be removed on master since 2.0 will require a full cluster restart.

Closes #8778
2014-12-04 14:07:58 +01:00
javanna 5f329bd607 Internal: remove bwc leftover
This caused some test failures as the readFrom method was not in sync anymore with the writeTo
2014-12-04 13:38:20 +01:00
Simon Willnauer 219bb88bc2 Remove runtime version checks
This cleanup commmit removes a large protion of the versioned reads / writes
in the network protocol since master requires a full cluster restart.
2014-12-04 11:31:29 +01:00
Simon Willnauer f4052fd936 Factor out PID file creation and add tests
This commit factors out the PID file creation from bootstrap and adds
tests for error conditions etc. We also can't rely on DELETE_ON_CLOSE
since it might not even write the file depending on the OS and JVM implementation.
This impl uses a shutdown hook to best-effort remove the pid file if it was written.

Closes #8771
2014-12-04 11:12:16 +01:00
Simon Willnauer ab0e3a6db2 [CLIENT] Add internal liveness action
This commit adds a very lightweight action to the transport
serivce that allows to fetch clustername and the discovery node
from a node. This is used by transport clients to test liveness of
a node without using the nodesinfo API which can be blocking if management
threadpools are busy.

Closes #8763
2014-12-04 10:49:20 +01:00
javanna 171e718f88 [DOCS] Document ActionNamesTests 2014-12-03 16:28:36 +01:00
javanna 6ccb46ef37 [TEST] remove action names bwc layer
The bwc layer added with #7105 is not needed in master as a full cluster restart will be required, thus from 2.0 on the only supported action names are compliant to the defined conventions and don't need to be converted to the old format

Closes #8758
2014-12-03 16:18:43 +01:00
David Pilato d2a2d1bb53 java: QueryBuilders cleanup: remove deprecated
Related to #8667:

Some QueryBuilders have been deprecated in 1.x branches. We removed them in 2.0.

Removed
-------

* `textPhrase(...)`
* `textPhrasePrefix(...)`
* `textPhrasePrefixQuery(...)`
* `filtered(...)`
* `inQuery(...)`
* `commonTerms(...)`
* `queryString(...)`
* `simpleQueryString(...)`

Closes #8721.
2014-12-03 16:07:34 +01:00
Simon Willnauer d732077900 [TEST] Wait for yellow before running rescorer tests 2014-12-03 10:03:45 +01:00
Simon Willnauer 921e028e99 [PLUGIN] Don't use atomic move when installing plugin
the extract location might be on a different filesystem where
atomic move won't work. Yet this operation is not critical in terms
of visibility so there is no need to do this.
2014-12-03 09:48:49 +01:00
Simon Willnauer a436da7cdb [PLUGIN] don't set posix permission on filesystem that don't support it 2014-12-03 09:47:54 +01:00
javanna 36e12d39fd [TEST] guarantee REST tests execution order
REST tests are being shuffled before their execution. To guarantee their repeatability given the seed, their order needs to be always the same before the shuffling happens.

Closes #8745
2014-12-03 08:36:15 +01:00
Simon Willnauer 3dfff84043 Revert back APIs that resolve files from classpath to java.net.URL
The conversion to the Path API doesn't work if the path points
to a file inside a JAR like a config. These path must be read
while the ZIP filesystem is opened which can't be guaranteed across
the board. This commit reverts back the relevant changes to java.net.URL
and adds a util method to read UTF-8 Encoded files from URLs correctly.
2014-12-03 00:09:35 +01:00
Simon Willnauer a6510f9245 Add File.java to forbidden APIs
This commit cuts over all of core (not quite all tests) to java.nio.Path
It also adds the file class to the core forbidden APIs to prevent its usage.

This commit also resolves #8254 since we now consistently useing the NIO Path
API. The Changes in this commit allow for more information if IO operations fail
since the NIO API throws exceptions instead of boolean return values. The build-in
methods used in this commit are also more resillient to encodeing errors like
unmappable characters and throw exceptions if those chars are present in a file.

Closes #8254
Closes #8666
2014-12-02 21:29:26 +01:00
Simon Willnauer d8f16178d3 Override write(byte[] b, int off, int len) in FilterOutputStream for better performance
Closes #8748
2014-12-02 21:20:53 +01:00
Adrien Grand 943dbb8ab6 Fix resource description of VerifyingIndexOutput. 2014-12-02 19:26:17 +01:00
Simon Willnauer 48ec6599c2 [TEST] use private randomness in InternalTestCluster 2014-12-02 18:22:44 +01:00
Simon Willnauer e3ed471d30 [TEST] speed up tests by reducing the recovery retry by default 2014-12-02 17:43:06 +01:00
Adrien Grand eba2bd51c1 Core: Upgrade to lucene-5.0.0-snapshot-1642891.
The only required change was to add a description to our index outputs.

Close #8743
2014-12-02 17:38:53 +01:00
Martijn van Groningen a8a5391255 Removed 1.x version check 2014-12-02 14:56:12 +01:00
Martijn van Groningen 4c159f1140 Fixed forgotten delegation 2014-12-02 14:50:57 +01:00
Simon Willnauer 8736543c71 [RECOVERY] Ensure shards are identical after recovery
Today we don't check if the recovery target has all the
files that we expect there after the recovery. This commit
adds aditional safety to ensure all files are present with the
correct checksums on recovery finalization.

Closes #8723
2014-12-02 14:05:44 +01:00
Simon Willnauer c1edcaf388 [RECOVERY] Make recovery delay configurable
Today we wait 500ms before we retry a recovery if the target node is not ready.
This happens if the source starts the recovery before the target has
processed the clusterstate moving the target shard into the right state.
This can cause a 500ms delay each time it happens while the shard is ready
way earlier on the target node. This commit makes this delay configurable
to mainly speed up test processing and shard allocation in tests.
2014-12-02 13:33:35 +01:00
Martijn van Groningen d7e224da04 Added `inner_hits` feature that allows to include nested hits.
Inner hits allows to embed nested inner objects, children documents or the parent document that contributed to the matching of the returned search hit as inner hits, which would otherwise be hidden.

Closes #8153
Closes #3022
Closes #3152
2014-12-02 12:01:01 +01:00
Simon Willnauer 942e752ac1 Remove unused member / argument on Store 2014-12-02 10:11:34 +01:00
Simon Willnauer 9b5b281fe8 [TEST] Ensure we have a mapping for all types on open/close 2014-12-02 10:11:04 +01:00
David Pilato 317192b647 java: QueryBuilders cleanup (add and deprecate)
Some QueryBuilders are missing or have a different naming than the other ones.

This patch is applied to branch 1.x and master (elasticsearch 1.5 and 2.0):

Added
-----

* `templateQuery(...)`
* `commonTermsQuery(...)`
* `queryStringQuery(...)`
* `simpleQueryStringQuery(...)`

Deprecated
----------

* `commonTerms(...)`
* `queryString(...)`
* `simpleQueryString(...)`
2014-12-01 14:41:25 +01:00
Simon Willnauer ade5aaae5f [TEST] Ensure that all flushes happen on PeerRecovery tests 2014-11-30 16:31:49 +01:00
Simon Willnauer c630b1e8a4 [TEST] Move NoMergePolicyProvider into it's own class 2014-11-30 16:31:49 +01:00
Simon Willnauer ca9abb1caf [TEST] wait for all shards to be allocated before IndexStatsTests runs 2014-11-29 20:11:21 +01:00
Simon Willnauer 539faf4e65 [TEST] Mute CircuitBreakerServiceTests.testMemoryBreaker
Relates to #8710
2014-11-29 20:07:19 +01:00
Simon Willnauer ef8802d878 [TEST] make sure number of shard is low in network corruption tests 2014-11-29 17:16:46 +01:00
Simon Willnauer 2d0309f0d4 [TEST] Use private random instance to build test cluster config 2014-11-29 16:06:05 +01:00
Simon Willnauer 75cc8ee097 [TEST] Speed up recoveries if tests.nighly=true 2014-11-29 15:37:15 +01:00
Simon Willnauer 7d3da915b0 [TEST] Don't fail test if dummy doc is not found
Relates to #8706
2014-11-29 15:36:05 +01:00
Lee Hinman 7776b6b4f0 [TEST] Use a pooling connection manager for REST tests 2014-11-28 22:04:01 +01:00
Simon Willnauer 29422c645b [TEST] Try to speed up REST tests by reducing max number of replicas and shards 2014-11-28 21:16:38 +01:00
Patrick Koenig 76157b8b90 Logging - provides template usage information on index creation
Closes #7421
2014-11-28 16:11:16 +00:00
Lee Hinman 1d8fd0fc04 [TEST] Explicit wait for fielddata breaker to be cleared 2014-11-28 15:56:11 +01:00
Lee Hinman f9d7e76928 [TEST] Relax constraints of breaker tests even more
They were very stringent, and add values in worst-case situations. The
new values are acceptable while still testing the functionality of the
breaker.
2014-11-28 15:12:09 +01:00
Alex Ksikes 256712640f MLT Query: Support for ignore docs
Adds a `ignore_like` parameter to the MLT Query, which simply tells the
algorithm to skip all the terms from the given documents. This could be useful
in order to better guide nearest neighbor search by telling the algorithm to
never explore the space spanned by the given `ignore_like` docs. In essence we
are interested about the characteristic of a given item, but not of the ones
provided by `ignore_like`, thereby forcing the algorithm to go deeper in its
selection of terms. Note that this is different than simply performing a must
not boolean query on the unliked items. The syntax is exactly the same as the
`like` parameter.

Closes #8674
2014-11-28 14:48:43 +01:00
Britta Weber 59507cf793 function_score: match only document with score above custom score threshold
functon_score matched each document regardless of the computed score.
This commit adds a query parameter `min_score` (-Float.MAX_VALUE default).
Documents that have a score lower than this threshold will not be mached.

closes #6952
2014-11-28 12:35:26 +01:00
Simon Willnauer 93b52c925d [TEST] With pipelining disabled requests can come back in any order
Closes #8697
2014-11-28 12:28:31 +01:00
Simon Willnauer 5c6c7f23ba [TEST] add back accidetially removed test logging 2014-11-28 11:01:15 +01:00
Simon Willnauer bc563931c3 [TEST] move test to a different class that can disable publish timeout on demand 2014-11-28 10:49:56 +01:00
Simon Willnauer c524e469ec [TEST] remove outdated TestLogging annotation
Conflicts:
	src/test/java/org/elasticsearch/bwcompat/UnicastBackwardsCompatibilityTest.java
	src/test/java/org/elasticsearch/recovery/RelocationTests.java
2014-11-28 10:44:06 +01:00
Lee Hinman 600f02b407 [TEST] Add an assert for null indices in InternalEngineIntegrationTest 2014-11-28 10:29:24 +01:00
Boaz Leskes 8456489773 Test: add trace logging to RelocationTests
also improved error message when failing to delete a dummy doc
2014-11-28 10:22:49 +01:00
Simon Willnauer b18675efb4 [TEST] Use different index on each iteration to ensure less timeout prone tests 2014-11-28 10:10:10 +01:00
Alex Ksikes d7338ffdbc MLT Query: Fix exclude with artificial documents
Artificial documents get assigned a random id. When include is set to false
(default), the ids of these documents also get included, when they should
rather be ignored.

Closes #8679
2014-11-28 08:07:57 +01:00
Simon Willnauer fe762c0eb5 [TEST] Reduce possible number of indices in the test - 10 indices can create tons of shards 2014-11-27 23:04:40 +01:00
Martijn van Groningen 06c39e79d6 Test: predefine sort fields in mapping, otherwise during the test the field may not be found if it were to be introduced dynamically at index time. 2014-11-27 17:57:35 +01:00
Simon Willnauer 6e4f3cf42d [CLIENT] Only fetch the node info during node sampling
Today we are fetching a lot of information that is unneeded
for the sampling phase. We only really need the DiscoveryNode
to ensure the node is still there.
This commit clears all flags to be false on the NodeInfo call.
2014-11-27 17:12:38 +01:00
Simon Willnauer c1832e36dc [HEALTH] Don't mark health as timed out if desired state is reached
Today we mark cluster health requests as timed out if the request has already
timed out. Yet, and implementation detail of the health request is that we are
waiting for events which can take quite some time if the machine is busy. If
we have already reached a valid state while waiting for events to be processed
we shouldn't mark the clusterstate as timed-out. This will help tests that
wait for green state with lots of nodes and shards to not fail the cluster health
calls.
2014-11-27 17:11:07 +01:00
Boaz Leskes cd717ab8e7 Test: UpdateTests.stressUpdateDeleteConcurrency shouldn't turn off threaded operations
This may result in all network threads being busy for too long.
2014-11-27 16:30:26 +01:00
javanna bf0387e0bc [TEST] make sure rest tests info is printed for any @Rest annotated test
We introduced the @Rest annotation a while ago for REST tests (see #7795), we have then to make sure that relevant info to reproduce failures gets printed out for any test that is marked with such annotation, not only for ElasticsearchRestTests

Closes #8680
2014-11-27 10:42:25 +01:00
javanna e07b0deecd [TEST] Extend unicast ports generation to support more concurrent clusters
Make it possible to run multiple tests with unicast configuration, by assigning ports based on their test scope.
Every jvm still gets its own port range based on the jvm id, but we now make sure that the different jvms ranges never overlap. The global cluster gets a reserved port range, while SUITE and TEST scopes are treated equally, just assuming that they never run concurrently on the same jvm, thus ports can be safely reused.

Closes #8634
2014-11-27 09:02:23 +01:00
javanna c2f1175692 [TEST] split base settings in ClusterDiscoveryConfiguration between node and transport client
The default settings that are currently applied to the transport client are about discovery and gateway, modules that are not even loaded on the transport client. We can now remove the local gateway as it's not the default one anyway. Also, make sure that the discovery setting is only applied to the node, as it is not relevant for transport client.

Closes #8653
2014-11-27 08:00:00 +01:00
Simon Willnauer 0c2fd314fc [TEST] Wait for green before testing IW settings 2014-11-26 21:47:24 +01:00
Simon Willnauer eba761e368 [TEST] Stabelize FunctionScoreBWC tests - allocation should be disabled during upgrade 2014-11-26 17:54:20 +01:00
Alexander Reelsen 432a8e6f52 Versions: Add 1.4.2/1.3.7 constants 2014-11-26 17:29:49 +01:00
Lee Hinman 5169339308 [TEST] Add additional logging to memoryCircuitBreaker test 2014-11-26 14:57:31 +01:00
Michael McCandless d9dfad0e9b Core: separately log file deletions
Today, you can turn on lucene.iw TRACE logging, but that produces tons
of output.  This changes breaks out separate lucene.iw.ifd and
index.store.deletes logger components (TRACE), disabled by default, to
see what part of Elasticsearch is deleting index files.

Closed #8662

Closed #8603
2014-11-26 05:10:47 -05:00
Martijn van Groningen 099b1a70d5 Core: Let the disk threshold decider take into account shards moving away from a node in order to determine if a shard can remain.
By taking this into account we can prevent that we move too many shards away than is necessary.

Closes #8538
Closes #8659
2014-11-26 10:14:02 +01:00
Simon Willnauer 716212c037 Raise REST test Timeout - LocalGW takes it't tall... 2014-11-26 09:12:34 +01:00
Igor Motov 7e0b75625b Core: clarify index removal log message 2014-11-25 21:50:07 -05:00
Chris Earle 08521a4066 Revert "Update to Jackson 2.4.3"
This reverts commit 7523d0b150.
2014-11-25 16:41:33 -05:00
Nicholas Knize 6692ac3b75 Adding unit test for even / odd boundary condition 2014-11-25 13:32:01 -06:00
Clément Tourrière 15db5b98d2 Fix for geohash neighbors when geohash length is even.
We don't have to set XLimit and YLimit depending on the level (even or odd), since semantics of x and y are already swapped on each level.
XLimit is always 7 and YLimit is always 3.

Close #8526
2014-11-25 13:31:56 -06:00
Chris Earle 7523d0b150 Update to Jackson 2.4.3
- Update pom to 2.4.3 from 2.4.2
- Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format
- Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object
- Cleans up `JsonVsCborTests` unused imports
2014-11-25 14:03:16 -05:00
Adrien Grand d22645cbfc Scripts: Return new lists on calls to getValues.
Scripts currently share the same list across invocations to getValues. This
caused a bug in script fields where all documents coming from the same segment
would get the same values (basically, for the next document for which script
values have been requested). Scripts now return a fresh new list on every
invocation to `getValues`.

Close #8576
2014-11-25 17:39:26 +01:00
Nils Dijk 0f4ca09e54 Aggregations: fix rounding issues on DST switch.
Closes #8339.
2014-11-25 16:48:03 +01:00
Simon Willnauer 9e7b15b8f3 [GATEWAY] Cut over MetaDataStateFormat to Path API
Closes #8609
2014-11-25 15:07:10 +01:00
Simon Willnauer 82868e9cf2 remove unnecessary clearScroll call - these contexts are released by delete index now 2014-11-25 14:53:38 +01:00
Martijn van Groningen 13d1bb5681 Parent/child: Fixed parent/child not being able to be used in alias filters.
Closes #8628
2014-11-25 14:46:29 +01:00
Simon Willnauer 0a4e041ee5 [RECOVERY] Throw IndexShardClosedException if shard is closed
Today we throw a generic ElasticsearchException when a recovery is cancled. This
causes verbose logging and send shard failures and additional unnecessary cluster state
events. We can just throw IndexShardClosedException which prevents the send shard failures
2014-11-25 14:35:06 +01:00
Simon Willnauer 35b278fc68 [TRANSLOG] Cut over to Path API
This commit moves all the Translog related code over to the
NIO2 Path API. It also make transaction logs write once since it
never reuses a translog file.

Closes #8611
2014-11-25 12:43:57 +01:00
Lee Hinman 6749b2c306 [TEST] Reduce stringency of breaker assertions
While in a perfect world we should only ever have 2 circuit breaker
trips, it's possible to get a race condition between the child and the
parent breaker with many threads. Since multiple breaking exceptions are
not actually a bad thing, it's okay to relax the constraints in the
test.

The race conditions are due to no locking inside the breaker logic, to
ensure that it is as low overhead as possible. Even though no locking is
used, we use atomic counters internally to ensure that the "estimated"
numbers for the breakers are never out of sync (which this test still
checks with no leeway).
2014-11-25 11:53:29 +01:00
Colin Goodheart-Smithe c420a17f7d Aggregations: Added getProperty method to Aggregations
This allows arbitrary properties to be retrieved from an aggregation tree. The property is specified using the same syntax as the
order parameter in the terms aggregation. If a property path contians a multi-bucket aggregation the property values from each bucket will be returned in an array.
2014-11-25 10:07:42 +00:00
Michael McCandless 856b294441 Core: let Lucene kick off merges
Today, Elasticsearch has a separate merge thread pool checking once
per second (by default) if any merges are necessary, but this is no
longer necessary since we can and do now tell Lucene's
ConcurrentMergeScheduler never to "hard pause" threads when merges
fall behind, since we do our own index throttling.

This change goes back to letting Lucene launch merges as needed, and
removes these two expert settings:

  index.merge.force_async_merge
  index.merge.async_interval

Now merges kick off immediately instead of waiting up to 1 second
before running.

Closes #8643
2014-11-25 04:13:57 -05:00
unknown c4e2f63b17 Aggregations: Make size parsing consistent for strings.
Close #6061
2014-11-25 08:55:24 +01:00
Igor Motov 668dbe498a Snapshot/Restore: fix compilation issue for JDK 1.7 2014-11-24 21:17:03 -05:00
Igor Motov 1aff8631ed Snapshot/Restore: restore with wait_for_completion=true should wait for succesfully restored shards to get started
This commit ensures that restore operation with wait_for_completion=true doesn't return until all successfully restored shards are started. Before it was returning as soon as restore operation was over, which cause some shards to be unavailable immediately after restore completion.

Fixes #8340
2014-11-24 19:37:43 -05:00
Adrien Grand d60500f22e Fielddata: Fix iterator over global ordinals.
Our iterator over global ordinals is currently incorrect since it does NOT
return -1 (NO_MORE_ORDS) when all ordinals have been consumed. This bug does
not strike immediately with elasticsearch since we always consume ordinals in
a random-access fashion. However it strikes when consuming ordinals through
Lucene helpers such as DocValues#docsWithField.

Close #8580
2014-11-24 19:42:53 +01:00
Martijn van Groningen 13b9e07522 Core: Fields defined in the `_default_` mapping of an index template should be picked up when an index alias filter is parsed if a new index is introduced when a document is indexed into an index that doesn't exist yet.
Closes #8473
2014-11-24 18:25:31 +01:00
Simon Willnauer 043b37d932 [GATEWAY] Remove _state directory if index has been deleted
Today we try to delete the index directory if all shard locks have been
acquired. Yet, if this fails due to still running recoveries etc. We might
re-import the index as dangeling which also can happen if the node is restarted.
In contrast to the shard direcotries we can safely delete the metastate which is used
to import dangling indices while leaving the shard directories untouched.
2014-11-24 16:00:45 +01:00
Reuben Sutton fda1576d55 Fix SearchRequest.templateParams so that it is a Map<String, Object> so that it can take more data-types than just strings, to support Arrays. 2014-11-24 14:46:48 +00:00
Nicholas Knize 08bbfac7eb Updating comments in BasePolygonBuilder to explain "pairwise" intersection 2014-11-24 08:34:10 -06:00
Nicholas Knize 82f5252c14 Removing IntersectionOrder.SENTINEL and adding Edge.MAX_COORDINATE for code readability. 2014-11-24 08:33:56 -06:00
Nicholas Knize fc955551d4 [GEO] Fix for geo_shape query with polygon from -180/90 to 180/-90
This fix adds a simple consistency check that intersection edges appear pairwise. Polygonal boundary tests were passing (false positive) on the Eastern side of the dateline simply due to the initial order (edge direction) of the intersection edges.  Polygons in the Eastern hemispehere (which were not being tested) were correctly failing inside of JTS due to an attempt to connect incorrect intersection edges (that is, edges that were not even intersections). While this patch fixes issue/8467 (and adds broader test coverage) it is not intented as a long term solution.  The mid term fix (in work) will refactor all geospatial computational geometry to use ENU / ECF coordinate systems for higher accuracy and eliminate brute force mercator checks and conversions.

Closes #8467
2014-11-24 08:31:36 -06:00
Martijn van Groningen 1d7cdd7d22 Applied PR, changed the way defaults are handled and updated the docs.
Closes #4452
2014-11-24 13:32:41 +01:00
Brusic 5a001e1357 Cleaner error handling. Pre without post (or vice versa) is not an error condition. Set appropriate defaults for pre/post. 2014-11-24 13:28:55 +01:00
Brusic 94074b4028 Use static int for easier to read code 2014-11-24 13:28:55 +01:00
Brusic 7c10b445d4 Expose dist/pre/post options for SpanNotQuery 2014-11-24 13:28:54 +01:00
Lee Hinman 45408844e7 Remove NoneGateway, NoneGatewayAllocator, & NoneGatewayModule
Always use the LocalGateway* equivalents

We already check in the LocalGateway whether a node is a client node, or
is not master-eligible, and skip writing the state there. This allows us
to remove this code that was previously used only for tribe nodes (which
are not master eligible anyway and wouldn't write state) and in
tests (which can shake more bugs out)
2014-11-24 12:22:05 +01:00
Michael McCandless dfb6d6081c Core: upgrade to current Lucene 5.0.0 snapshot
Elasticsearch no longer unlocks the Lucene index on startup (this was
dangerous, and could possibly lead to corruption).

Added the new serbian_normalization TokenFilter from Lucene.

NoLockFactory is no longer supported (index.store.fs.fs_lock = none),
and if you have a typo in your fs_lock you'll now hit a StoreException
instead of silently using NoLockFactory.

Closes #8588
2014-11-24 05:08:42 -05:00
Adrien Grand 8346e92ebb Core: Fix script fields to be returned as a multivalued field when they produce a list.
This change is essentially the same as #3015 but on script fields.

Close #8592
2014-11-24 09:41:16 +01:00
Simon Willnauer b6b3382a8b [STORE] Use Lucene checksums if segment version is >= 4.9.0
We started to use the lucene CRC32 checksums instead of the legacy Adler32
in `v1.3.0` which was the first version using lucene `4.9.0`. We can safely
assume that if the segment was written with this version that checksums
from lucene can be used even if the legacy checksum claims that it has a Adler32
for a given file / segment.

Closes #8587

Conflicts:
	src/main/java/org/elasticsearch/index/store/Store.java
	src/test/java/org/elasticsearch/index/store/StoreTest.java
2014-11-21 22:35:21 +01:00
ananich 95a396159c Added utility method to CountRequestBuilder
Allows to add a query to CountRequestBuilder as a XContentBuilder.

Closes #8594
2014-11-21 21:04:01 +01:00
Simon Willnauer 1c00790213 [TEST] all tests should extend ElasticsearchTestCase 2014-11-21 20:27:52 +01:00
Andreas Kohn 3205dce549 Fix a typo in a javadoc comment in MapperService.
Close #8575
2014-11-21 19:28:34 +01:00
Damien Alexandre 80295458ad Fix wrong error messages in MultiMatchQueryParser.
Also fix a typo in the comment

Close #8597
2014-11-21 19:28:34 +01:00
Ryan Ernst 40598a5692 Fix test failures caused by #8556 2014-11-21 10:22:13 -08:00
Ryan Ernst 4a3afcc0d3 Fix compile error from bad merge in #8556 2014-11-21 09:33:36 -08:00
Ryan Ernst fae9dcaed7 DateMath: Fix semantics of rounding with inclusive/exclusive ranges.
Date math rounding currently works by rounding the date up or down based
on the scope of the rounding.  For example, if you have the date
`2009-12-24||/d` it will round down to the inclusive lower end
`2009-12-24T00:00:00.000` and round up to the non-inclusive date
`2009-12-25T00:00:00.000`.

The range endpoint semantics work as follows:
* `gt` - round D down, and use > that value
* `gte` - round D down, and use >= that value
* `lt` - round D down, and use <
* `lte` - round D up, and use <=

There are 2 problems with these semantics:
* `lte` ends up including the upper value, which should be non-inclusive
* `gt` only excludes the beginning of the date, not the entire rounding scope

This change makes the range endpoint semantics symmetrical.  First, it
changes the parser to round up and down using the first (same as before)
and last (1 ms less than before) values of the rounding scope.  This
makes both rounded endpoints inclusive. The range endpoint semantics
are then as follows:
* `gt` - round D up, and use > that value
* `gte` - round D down, and use >= that value
* `lt` - round D down, and use < that value
* `lte` - round D up, and use <= that value

closes #8424
closes #8556
2014-11-21 09:28:30 -08:00
Alex Ksikes 1959275622 Term Vectors: More consistent naming for term vector[s]
We speak of the term vectors of a document, where each field has an associated
stored term vector. Since by default we are requesting all the term vectors of
a document, the HTTP request endpoint should rather be called `_termvectors`
instead of `_termvector`. The usage of `_termvector` is now deprecated, as
well as the transport client call to termVector and prepareTermVector.

Closes #8484
2014-11-21 14:06:44 +01:00
Simon Willnauer a6e6c4efc4 [CORE] Ensure shards are deleted under lock on close
Today there is a race condition between the actual deletion of
the shard and the release of the lock in the store. This race can cause
rare imports of dangeling indices if the cluster state update loop
tires to import the dangeling index in that particular windonw. This commit
adds more safety to the import of dangeling indices and removes the race
condition by holding on to the lock on store closing while the listener
is notified.
2014-11-21 12:20:58 +01:00
Adrien Grand abc0bc4c7f Aggregations: Fix geohash grid doc counts computation on multi-valued fields.
Close #8512
2014-11-21 11:02:04 +01:00
Thomas Cucchietti 98641ff39f Update DiskThresholdDecider javadoc
Since v1.3.0, and issue #6201, the default values in code and documentation have been updated to 85% and 90% for low and high watermarks. However, the related javadoc still contains the initial values : this commit fix this.
2014-11-21 10:24:24 +01:00
Robert Muir 9ef69f9f36 Disable bloom filters.
make the "es090" postings format read-only, just to support old segments. There is a test version that subclasses it with write-capability for testing.

Closes #8571
2014-11-20 21:03:23 -05:00
Simon Willnauer 3e1b7c7a34 [BLOOM] Fix Bloom filter ram usage calculation
BloomFilter actually returned the size of the bitset as the
size in bytes so off by factor 8 plus a constant :)

Closes #8564
2014-11-20 22:45:28 +01:00
Simon Willnauer afa62e90d9 [CORE] Free pending search contexts if index is closed
Today we hold on to search context reference if they are not cleaned
up for a while until a reaper thread trashes them if they timed out.
This commit removes all pending contexts once the index is closed to release
resources and filehandles immediatly once the index is closed.
2014-11-20 16:13:35 +01:00
Simon Willnauer d5d5dece56 [INDEX] Add before/after indexDeleted callbacks to IndicesLifecycle
In order to implement #8551 correctly without causing problems of relocating
shards we need to be informed if an index is actually deleted. This commit adds
more callbacks to the listener and makes deleteIndex a dedicated method on IndicesService
2014-11-20 15:37:35 +01:00
Simon Willnauer 26b4ebcd00 [TEST] Delete index in test to release file handles 2014-11-20 15:35:08 +01:00
Simon Willnauer 17110508ac Add missing await into an interruptable block 2014-11-20 15:35:08 +01:00
Britta Weber 06e907d99e Revert "[TEST] use logger level from test class annotation also in external nodes"
This reverts commit 4604a68bef.
2014-11-20 15:29:44 +01:00
Simon Willnauer 0fcb466555 [STORE] Remove `memory`/ `ram` store
The RAM store is discuraged for production usage anyway and
we don't test it in our randomized infrastructure. This commit
removes it for `2.0`
2014-11-20 14:47:19 +01:00
markharwood 0c94314996 Parser throws NullPointerException when Filter aggregation clause is empty.
Added Junit test that recreates the error and fixed FilterParser to default to using a MatchAllDocsFilter if the requested filter clause is left empty.
Also added fix and test for the Filters (with an "s") aggregation.

Closes #8438
2014-11-20 13:06:11 +00:00