Commit Graph

4057 Commits

Author SHA1 Message Date
javanna 442dda2ac8 [TEST] _id is not indexed by default, sort on score,_uid in MultiMatchQueryTests 2014-04-18 15:09:00 +02:00
Martijn van Groningen a808fe9d46 Moved the updateMappingOnMaster logic into a single place.
Closes #5798
2014-04-18 19:27:13 +07:00
javanna d6a676724a [TEST] added sort by "_id" when score is the same to MultiMatchQueryTests#testEquivalence
A merge (and refresh) might rarely happen in the background between the two queries whose output is compared. It might then happen that two docs with same scores get returned by the two queries in a different order due to different lucene document id (which has changed in the meantime). To fix this we need to order by id when the score is the same, so that we can safely compare the output of the two queries (multimatch and dismax).
2014-04-18 12:15:44 +02:00
Martijn van Groningen a73286bcc4 [TEST] Use startNodesAsync in unicast discovery tests. 2014-04-17 11:51:11 +07:00
Simon Willnauer 0948260ada [TEST] make testTimeoutSendExceptionWithDelayedResponse more reliable on slow systems 2014-04-16 22:59:31 +02:00
Simon Willnauer 1755ae7470 Added version constants for 1.1.2 and 1.0.4 2014-04-16 17:21:19 +02:00
Boaz Leskes 0887e68d4b [Test] InternalEngineTests: increased gc deletes interval & turn it off randomly 2014-04-16 15:59:56 +02:00
Simon Willnauer 26adb37f09 [TEST] Ignore bogus system properties.
LuceneTestCase might reset some solr properties that cause
our tests to fail if the run before in the same JVM We just ignore
solr properties.
2014-04-16 15:19:17 +02:00
Simon Willnauer 3530c8be7e [TEST] catch exceptions if TTL already expired when indexing
TTLPercolatorTests indexes docs with small TTLs which can trigger
AlreadyExpiredException exception. This is expected while rare and
we should just catch them.
2014-04-16 15:10:28 +02:00
Simon Willnauer be14968c44 Ensure close is called under lock in the case of an engine failure
Until today we did close the engine without aqcuireing the write lock
since most calls were still holding a read lock. This commit removes
the code that holds on to the readlock when failing the engine which
means we can simply call #close()
2014-04-16 14:50:40 +02:00
Boaz Leskes 099b9c6b06 add debug logs if failed shards can not be resolved. 2014-04-16 14:45:54 +02:00
Martijn van Groningen 840d1b4b8e [TEST] Reduce the amount of docs being indexed. 2014-04-16 15:49:24 +07:00
Martijn van Groningen 98deb5537f Better deal with invalid scroll ids.
Closes #5738
2014-04-16 14:13:29 +07:00
Simon Willnauer 8df5d4c37e [TEST] Fix PercolatorTests#testSimple2
This test requires a mapping since otherwise if there is no mapping
added the percolator query might not be parsed as a query on a numeric
field since the query might arrive on a node before the dynamic mapping
reached that node.

This commit also moves the `indexService.readAllowed()` call up before
the number of percolation queries is check to make sure we fail if reads
are not allowed - there might be a query in-flight which means we need
to check another node rather than return an empty result.
2014-04-15 23:01:35 +02:00
Lee Hinman 65e72a5be5 [TEST] Wait for green, and refresh after indexing in percolator test 2014-04-15 11:19:41 -06:00
Simon Willnauer c5c87c4a48 [TEST] Don't delete data dirs after test - only delete their content.
Closes #5815
2014-04-15 17:03:31 +02:00
Simon Willnauer 320a206352 Switch back to ConcurrentMergeScheduler
Load tests showed that SerialMS has problems to keep up with
the merges under high load. We should switch back to CMS
until we have a better story to balance merge
threads / efforts across shards on a single node.

Closes #5817
2014-04-15 16:42:23 +02:00
Adrien Grand 9920084ba2 [TEST] Wait for shards to be allocated before running testUpdateMappingDynamicallyWhilePercolating.
If the percolate request is executed soon enough, all shards fail and the
mapping is not actually updated.
2014-04-15 16:20:16 +02:00
Martijn van Groningen 202b1e2306 Update clusterstate if mapping service has local changes
If the during percolating a new field was introduced
in the local mapping service, then those changes should
be updated in cluster state of the master as well.

Closes #5776
2014-04-15 13:41:01 +02:00
Simon Willnauer 7c6d745523 Cleanup FileSystemUtils#mkdirs(File)
This methods had some workarounds for bugs that seem to be fixed
in Java 7 [1]. There seem to be other problems on shared file-systems
which are not really supported by lucene anyway or rather not
recommeded. Yet the current solution that interrupts a static thread
reference is too dangrous given all the usage of NIO across
elasticsearch.

[1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4742723
2014-04-15 13:22:51 +02:00
Simon Willnauer 8dd5dd409e Remove FileSystemUtils#maxOpenFiles
This method basically forcefully creates as many files as possible
to find out the process limit in a brute-force manner. The number of
possible probles with this approach would exceed the number of lines
left on this commit message.

This commit uses a JMX based alternative to print the process limit.
2014-04-15 13:22:51 +02:00
Shay Banon bc5bdbc5de Remove jsr166y now that we on Java 7, cleanup jsr166e to classes we use 2014-04-15 13:17:28 +02:00
Simon Willnauer 8bede7024f Use TransportBulkAction for internal request from IndicesTTLService
This prevents executing bulks internal autocreate indices logic
and ensures that this internal request never creates an index
automaticall.

This fixes a bug where the TTL purger thread ran after the actual
index it was purging was already closed / deleted and that re-created
that index.

Closes #5766
2014-04-15 12:40:25 +02:00
Igor Motov 3d23a71fa7 Fix snapshot status with empty repository
The snapshot status command with empty repository should return current status of currently running snapshots in all repositories.

Fixes #5790
2014-04-14 19:02:41 -04:00
Igor Motov 2ed8c632be Separate persistent and global metadata serialization settings 2014-04-14 16:25:33 -04:00
Simon Willnauer 0564c883be Remove unused FileSystemUtils#copyFile 2014-04-14 21:48:27 +02:00
Simon Willnauer a215dd3ae8 Prevent fsync from creating 0-byte files
This is related to LUCENE-5570 where fsync creates a 0-byte file
if the file does not exists. This commit adds the patched lucene
version using Java 7 APIs as well as a note to replace this method
with the upcomeing IOUtils#fsync in Lucene 4.8

This commit cleans up FsImmutableBlobContainer#writeBlob to make
use of Java7 Auto-Closing features and ensures that the directory
the blob was written to is fsynced as well if possible.
2014-04-14 21:48:23 +02:00
Adrien Grand e458d4fd93 Improved SearchContext.addReleasable.
For resources that have their life time effectively defined by the search
context they are attached to, it is convenient to use the search context to
schedule the release of such resources.

This commit changes aggregations to use this mechanism and also introduces
a `Lifetime` object that can be used to define how long the object should
live:
 - COLLECTION: if the object only needs to live during collection time and is
   what SearchContext.addReleasable would have chosen before this change
   (used for p/c queries),
 - SEARCH_PHASE for resources that only need to live during the current search
   phase (DFS, QUERY or FETCH),
 - SEARCH_CONTEXT for resources that need to live until the context is
   destroyed.

Aggregators are currently registed with SEARCH_CONTEXT. The reason is that when
using the DFS_QUERY_THEN_FETCH search type, they are allocated during the DFS
phase but only used during the QUERY phase. However we should fix it in order
to only allocate them during the QUERY phase and use SEARCH_PHASE as a life
time.

Close #5703
2014-04-14 17:42:41 +02:00
Adrien Grand e589301806 Make Releasable extend AutoCloseable.
Java7's AutoCloseable allows to manage resources more nicely using
try-with-resources statements. Since the semantics of our Releasable interface
are very close to a Closeable, let's switch to it.

Close #5689
2014-04-14 17:21:42 +02:00
Adrien Grand e688f445ad [TEST] Use indexRandom in ShardSizeTests. 2014-04-14 12:31:34 +02:00
Simon Willnauer 1ce56ff969 Revert "Don't lookup version for auto generated id and create"
This reverts commit dc73498454.
2014-04-14 12:15:02 +02:00
Shay Banon dc73498454 Don't lookup version for auto generated id and create
When a create document is executed, and its an auto generated id (based on UUID), we know that the document will not exists in the index, so there is no need to try and lookup the version from the index.
For many cases, like logging, where ids are auto generated, this can improve the indexing performance, specifically for lightweight documents where analysis is not a big part of the execution.
2014-04-14 10:06:53 +02:00
Simon Willnauer ad143e16cf [TEST] Fix ClusterStatsTests#testValuesSmokeScreen to wait for yellow to get reliable FS stats. 2014-04-12 23:02:31 +02:00
Simon Willnauer ec3c635696 [TEST] use a real upperbound for the check on the time spend during suggestions 2014-04-12 21:54:46 +02:00
Shay Banon e9c0dd9ae4 [Test] should be abstract 2014-04-12 16:14:58 +02:00
Simon Willnauer efb749936b [TEST] Improve performance of MockBigArray MockPageRecycler 2014-04-11 23:02:59 +02:00
Simon Willnauer 5d611a9098 Ensure pending merges are updated on segment flushes
Due to the default of `async_merge` to `true` we never run
the merge policy on a segment flush which prevented the
pending merges from being updated and that caused actual
pending merges not to contribute to the merge decision.

This commit also removes the `index.async.merge` setting is actually
misleading since we take care of merges not being excecuted on the
indexing threads  on a different level (the merge scheduler) since 1.1.

This commit also adds an additional check when to run a refresh
since soely relying on the dirty flag might leave merges un-refreshed
which can cause search slowdowns and higher memory consumption.

Closes #5779
2014-04-11 23:02:59 +02:00
Boaz Leskes e0fbd5df52 PR #5706 introduced a bug in the sparse array-backed field data
When we load sparse single valued data, we automatically assign a missing value to represent a document who has none. We try to find a value that will increase the number of bits needed to represent the data. If that missing value happen to be 0, we do no properly intialize the value array.

This commit solved this problem but also cleans up the code even more to make spotting such issues easier in the future.
2014-04-11 21:34:36 +02:00
Boaz Leskes 63d1fa45ab Added awaitFix for SimpleNestedTests.testSortNestedWithNestedFilter
While investigating failures
2014-04-11 18:12:35 +02:00
Boaz Leskes f549472fea Fixed- PackedArrayIndexFieldData.chooseStorageFormat compared to Long.MAX_VALUE instead of Long.MIN_VALUE
Also made the LongFieldDataTests.SINGLE_VALUED_SPARSE_RANDOM & LongFieldDataTests.MULTI_VALUED_SPARSE_RANDOM more sparse
2014-04-11 16:40:47 +02:00
Boaz Leskes 1d1ca3befc Added a AppendingDeltaPackedLongBuffer-based storage format to single value field data
The AppendingDeltaPackedLongBuffer uses delta compression in paged fashion. For data which is roughly monotonic this results in reduced memory signature.

By default we use the storage format expected to use the least memory. You can force a choice using a new field data setting `memory_storage_hint` which can be set to `ORDINALS`, `PACKED` or `PAGED`

Closes #5706
2014-04-11 15:50:34 +02:00
Chris Earle e8ea9d7585 Strengthening pseudo random number generator and adding tests to verify its behavior.
Closes #5454 and #5578
2014-04-11 14:01:40 +02:00
Martijn van Groningen 45a1b44759 Each search request should use a new InternalSearchResponse instance even in case when all shards return no hits.
The InternalSearchResponse may get modified afterwards, so a new instance required at all times.
2014-04-11 17:44:21 +07:00
Simon Willnauer 862611b792 [TEST] Prevent TTLPurger from recreating deleted index
Related to #5766
2014-04-11 09:03:28 +02:00
Martijn van Groningen b400129597 The clear scroll apis now optionally accepts a scroll_id in it body.
Closes #5726
2014-04-11 10:39:59 +07:00
Martijn van Groningen c4a49c2488 Fixed an where a nested `nested` aggregation falls outside of its parent `nested` aggregation bounds.
The nested `nested` aggs now gets the proper parent docs that define its bounds correctly.

Closes #5728
2014-04-11 10:16:17 +07:00
Martijn van Groningen 7bf3ffe73c Added test with AwaitsFix annotation that simulates a split brain. 2014-04-10 20:13:59 +07:00
Shay Banon 7a26b49298 Use startNodesAsync in more tests 2014-04-10 14:59:11 +02:00
Adrien Grand 53cbaa0af1 [TESTS] Add more assertSearchResponse to aggregations tests. 2014-04-10 11:34:41 +02:00
Simon Willnauer 206799662c [TEST] Allow higher ClusterHealthTimeout on tests if configuration is slow 2014-04-10 10:49:32 +02:00
Simon Willnauer 34a3e8af35 Add better error reporting to RestApiParser if assertions are tripped 2014-04-09 23:16:17 +02:00
Andrew Selden e2c8ff92ba Benchmark API
Add an API endpoint at /_bench for submitting, listing, and aborting
search benchmarks. This API can be used for timing search requests,
subject to various user-defined settings.

Benchmark results provide summary and detailed statistics on such
values as min, max, and mean time. Values are reported per-node so that
it is easy to spot outliers. Slow requests are also reported.

Long running benchmarks can be viewed with a GET request, or aborted
with a POST request.

Benchmark results are optionally stored in an index for subsequent
analysis.

Closes #5407
2014-04-09 13:06:55 -07:00
Lee Hinman 9aa1cb408e Fix format string for DiskThresholdDecider reroute explanation 2014-04-09 08:49:49 -06:00
Costin Leau 960d353dbd Remove plugin isolation feature for a future version
relates #5261
2014-04-09 17:28:11 +03:00
Simon Willnauer cd0c0de088 [TEST] RecoveryWhileunderLoadTests sometimes need higher timeouts
In some cases when we have a lot of docs with lots of shards
recovery takes longer than 1m causing the tests to fail before all
shards are recovered. This commit raises the timeout in this test to
5m max while it's rarely needed.

This commit also adds an assertion to ElasticsearchAssertions that
ensures that the cluster health requests are not hitting a timeout.
2014-04-09 11:37:02 +02:00
Boaz Leskes 6d966837d1 [Test] recoverWhileRelocating: Increase timeout while waiting for shards to replicate. 2014-04-08 20:53:31 +02:00
Simon Willnauer adc9a250ab Fix P/C assertions for rewrite reader
Inner queries must be rewritten as soon as a weight is pulled ie. must
be non-null.

Closes #5731
2014-04-08 17:47:31 +02:00
Simon Willnauer 5b6fd6de42 [TEST] Fix testRandomDirectoryIOExceptions to wait for green on reopen & add more assertions 2014-04-08 17:46:56 +02:00
Simon Willnauer a98b3fa1ff Revert "[TEST] Log where locks are created from if they are still open on close()"
This reverts commit 7eb8b0d0c0.
2014-04-08 16:18:15 +02:00
Simon Willnauer 7eb8b0d0c0 [TEST] Log where locks are created from if they are still open on close() 2014-04-08 15:14:08 +02:00
Simon Willnauer de13d707ed [TEST] Wait for LANGUID events to be processed before pulling stats 2014-04-08 12:41:13 +02:00
Boaz Leskes e8467f0978 Failed shards could be re-assigned to the same nodes if multiple replicas failed at once
After a shard fails on a node we assign a new replica on another node. This is important in order to avoid failing again due to node specific problems. In the rare case where two different replicas of the same shard failed in a short time span, we may fail to do so and assign one of them back to the node it's currently on. This happens if both shard failed events are processed within the same batch on the master.

Closes #5725
2014-04-08 12:10:45 +02:00
Simon Willnauer c58b823e9f [TEST] Add more randomization to bulk tests 2014-04-08 11:38:08 +02:00
Simon Willnauer fd8a6ac382 [TEST] make BulkTest more robust if test infra is slow 2014-04-08 11:11:56 +02:00
Shay Banon a1d0eee6bf [TEST] return the correct transport instance in mock transport 2014-04-07 22:34:56 +02:00
Simon Willnauer 49c74e0885 Rename successulOps to successfulOps in TransportSearchTypeAction 2014-04-07 22:15:09 +02:00
Simon Willnauer befa833385 Make sure successful operations are correct if second phase is fast
In TransportSearchTypeAction we  need to increment successful ops
first before we increment and compare the exit condition otherwise if we
are fast we could concurrently update totalOps but then preempt one
of the threads which can cause the successor to read a wrong value from
successfulOps if second phase is very fast ie. searchType == count etc.
This can cause wrong success stats in the search response.
2014-04-07 22:15:09 +02:00
Simon Willnauer f2181d5cbf [TEST] Be more verbose if ClusterStatsTests fails 2014-04-07 22:14:10 +02:00
Andrew Selden 033e46f8af Rename readPrimitive*Array()/writePrimitive*Array() methods
Make method names shorter and easier to read.

Closes #5711
2014-04-07 11:15:21 -07:00
Matt Weber e3187d5b9a Update LongHash to work like BytesRefHash.
- rename "key" to "get"
- update and add more tests

Closes #5693
2014-04-07 19:59:08 +02:00
Andrew Selden fb338ef753 Make writePrimitive*() and readPrimitive*() methods public.
These utility methods are useful for client code to read/write arrays of
primitive types.
2014-04-07 10:38:57 -07:00
Simon Willnauer f1a8aadb63 [TEST] null out static resources in base test classes 2014-04-07 18:17:25 +02:00
javanna 1ec4f8f04b [TEST] Replaced RestTestSuiteRunner with parametrized test that uses RandomizedRunner directly
ElasticsearchRestTests extends now ElasticsearchIntegrationTest and makes use of our ordinary test infrastructure, in particular all randomized aspects now come for free instead of having to maintain a separate (custom) tests runner

We previously parsed only the tests that needed to be run given the version of the cluster the tests are running against. This doesn't happen anymore as it didn't buy much and it would be harder to support as the tests get now parsed before the test cluster gets started. Thus all the tests are now parsed regardless of their skip sections, afterwards the ones that don't need to be run will be skipped through assume directives.

Fixed REST tests that rely on a specific number of shards as this change introduces also random number of shards and replicas (through randomIndexTemplate)

Closes #5654
2014-04-07 17:08:05 +02:00
Shay Banon 705c7e2469 Recycled bytes in http + rest layer refactoring phase 2
Refactor the rest layer handlers to simplify common code paths (like handling) failures, and introduce optional (enabled for netty) rest channel bytes recycling
2014-04-07 15:29:04 +02:00
uboness c9b0b04f55 Aggregation cleanup
- consolidated value source parsing under a single parser that is reused in all the value source aggs parsers
- consolidated include/exclude parsing under a single parser
- cleaned up value format handling, to have consistent behaviour across all values source aggs
2014-04-07 14:34:17 +02:00
Miltos Allamanis dc15dee323 Renamed ClusterBlocks variable named "block" to "blocks".
"blocks" has been used 9 times for variable names of type
ClusterBlocks but block has been used only this case. It
seems to be a typo.
2014-04-07 12:26:06 +02:00
Miltos Allamanis 40a1ac82ef Renamed XContentParser.Token named "t" to "token".
The name "token" was declared 191 times for XContentParser.Token
objects, while "t" was used only 6 times.
2014-04-07 12:26:06 +02:00
Shay Banon 37c07ef765 disable args tests that cause page/array leak
related to #5703
2014-04-07 11:25:18 +02:00
Shay Banon d64d0d6a97 Remove clear on mock page/array
since we use a shared cluster, calling clear on the mock array / page recycler can cause removing a valid on going reference, and then when its released, the release will fail because it can't be found.
There is no real reason to call clear, checking if pages/arrays have been released takes the snapshot behavior here into account.
This change also makes sure we don't use the mock classes in places where we don't really release.

Note, with this change DoubleTermsTests fails, since it causes failures when creating aggs in the pre process phase, causing obtained arrays not to be released. This needs to be fixed before pulling this change in.
2014-04-07 11:25:18 +02:00
Kevin Wang ecab74fe6c add lucene language model similarities (Dirichlet & JelinekMercer) 2014-04-07 10:48:03 +02:00
Adrien Grand 9df655adb2 Remove AtomicFieldData.isValuesOrdered.
This method is not used anymore.

Close #5688
2014-04-07 10:30:10 +02:00
Kevin Wang 866c520abb Add doc value for binary field.
Close #5669
2014-04-07 10:18:55 +02:00
Martijn van Groningen ade1d0ef57 Added global ordinals (unique incremental numbering for terms) to fielddata.
Added a terms aggregation implementations that work on global ordinals, which is also the default.

Closes #5672
2014-04-07 11:06:41 +07:00
Boaz Leskes 7b9df39800 [Test] Added better control over the number of documents indexed by BackgroundIndexer
Used the new controls to reduce indexing activity in RelocationTests and RecoveryWhileUnderLoadTests

Closes #5696
2014-04-06 20:49:27 +02:00
Shay Banon d26a956231 releasable bytes output + use in transport / translog
create a new releasable bytes output, that can be recycled, and use it in netty and the translog, 2 areas where the recycling will help nicely.
Note, opted for statically typed enforced releasble bytes output, to make sure people take the extra care to control when the bytes reference are released.
 Also, the mock page/array classes were fixed to not take into account potential recycling going during teardown, for example, on a shared cluster ping requests still happen, so recycling happen actively during teardown.
closes #5691
2014-04-06 20:23:21 +02:00
Simon Willnauer a5aafbb04c [TEST] Prevent RelocationTests from going crazy when relocations take time 2014-04-05 22:36:16 +02:00
Simon Willnauer 124d370b5f [TEST] cleanup secondary cluster properly in Tribe tests. 2014-04-05 22:18:38 +02:00
Lee Hinman 211f740100 Add `getAsRatio` to Settings class, allow DiskThresholdDecider to take percentages
Adds new RatioValue class that parses ratios between 0-100% expressed in
either floating-point (0.13) or percentage (51.12%) notation.

Closes #5690
2014-04-04 13:19:35 -06:00
Lee Hinman 3248359660 log full exception in InternalClusterInfoService unless it's a ClusterBlockException 2014-04-04 13:06:01 -06:00
Daniel Winterstein 08be94b455 Adding javadoc to UpdateRequestBuilder for a couple of details it took me a while to find. 2014-04-04 17:56:08 +02:00
Timo Rantalaiho 3ae02b0b60 Show stacktrace of startup exception
Whether or not the stacktrace is displayed is controlled by bootstrap
log level setting, so that bootstrap: DEBUG displays the stack trace on
output, like it does on log

Closes #5102
2014-04-04 17:15:41 +02:00
Simon Willnauer 4d6eb369a3 [TEST] Wait for nodes to join before asserting on cluster stats 2014-04-04 14:06:09 +02:00
Boaz Leskes 940954bfd1 [Test] added trace logging to refresh action to note which cluster version was used
Increase logging level for SearchWithRandomExceptionsTests.testRandomExceptions & MinDocCountTests to use the above and log cluster states on changes.
2014-04-04 13:17:28 +02:00
Kevin Wang f582212c68 `geo_point` doesn't allow null values
After upgrading to 1.1.0, sending null values to geo points produces the following error:

```
MapperParsingException[failed to parse]; nested: ElasticsearchParseException[geo_point expected];
```

Closes #5680.
Closes #5681.
2014-04-04 10:53:10 +02:00
Adrien Grand 8a09ec0e06 [TEST] Harden GeoShapeIntegrationTests. 2014-04-04 09:41:07 +02:00
Simon Willnauer df9346dc67 [TEST] build index up-front to prevent relocations 2014-04-03 19:31:22 +02:00
Simon Willnauer cd552e7413 Take stream position into account when calculating remaining length
Currently `PagedBytesReferenceStreamInput#read(byte[],int,int)` ignores
the current pos and that causes to read past EOF

Closes #5667
2014-04-03 17:44:41 +02:00
Adrien Grand 8f324d50b2 [TEST] Reduce number of documents/terms in aggregations' RandomTests.
This test initially had three purposes:
 - duels between equivalent aggregations on significant amounts of data,
 - make sure that array growth works (when the number of buckets grows larger
   than the initial number o buckets),
 - make sure that page recycling works correctly.

Because of the last point, it needed large numbers of docs/terms since page
recycling only kicks in on arrays of more than 16KB. However, since then, we
added a MockPageCacheRecycler to track allocation/release of BigArrays and make
sure that all arrays get released, so we can now lower these numbers of docs/
terms to just make sure that array growth is triggered.
2014-04-03 16:58:44 +02:00
Simon Willnauer 1fc664cc28 [TEST] Fix [Children|Parent]ConstantScoreQueryTests with nightly=true
Those tests use RandomIW which can flush after each document taking forever
to index the 20k docs it was indexing. This commit makes sure the IW is
sane and the number of docs is not too crazy.
2014-04-03 16:25:15 +02:00
Adrien Grand c78bb4472a [TEST] Make sure refresh is called by `indexRandom`, even if the list of documents to index is empty. 2014-04-03 15:57:54 +02:00
Martijn van Groningen 6f0904c7f1 sizeInBytes can be 0 2014-04-03 20:48:50 +07:00
Simon Willnauer 697432390d [TEST] Make BulkTests#testBulkProcessorFlush more robust 2014-04-03 13:32:41 +02:00
Simon Willnauer 7bc5ab45bc Cleanup IndicesFieldDataCache and IndexFieldDataCache
This commit adds several asserts and removes possible `null` values
from the `FieldDataCache` implementation.

Closes #5664
2014-04-03 12:50:51 +02:00
Martijn van Groningen f389c666c1 Moved the decision to load p/c fielddata eagerly to a better place.
Closes #5569
2014-04-03 14:45:07 +07:00
Alexander Reelsen f0ae43bbea Made template endpoint compatible with search endpoint
Before this the from/size parameters did not work.
Also updated the rest api spec definition file with all the query_string
parameters.

Fixes #5550
2014-04-03 00:01:30 +02:00
Alexander Reelsen e547e113e1 Geo context suggester: Require precision in mapping
The default precision was way too exact and could lead people to
think that geo context suggestions are not working. This patch now
requires you to set the precision in the mapping, as elasticsearch itself
can never tell exactly, what the required precision for the users
suggestions are.

Closes #5621
2014-04-02 23:51:14 +02:00
kul dc19e06e27 Add `flush` method for BulkProcessor class
There is no explicit method `flush/execute` in `BulkProcessor` class. This can be useful in certain scenarios.
Currently it requires to close and create a new BulkProcessor if one wants an immediate flush.

Closes #5575.
Closes #5570.
2014-04-02 19:16:29 +02:00
Britta Weber 0b449d3040 Document es.node.mode and add possible options to error message 2014-04-02 18:32:03 +02:00
Simon Willnauer e189b3e37b [TEST] Use NoMergePolicy rather than NoMergeScheduler in FreqTermsEnumTests 2014-04-02 14:58:45 +02:00
Adrien Grand 4ff3e1926b Remove ScriptDocValues.EMPTY.
Instead the default implementation is used, but on top of empty
(Bytes|Long|Double|GeoPoint)Values. This makes sure there is no
inconsistency between documents depending on whether other documents in the
segment have values or not.

Close #5646
2014-04-02 14:28:42 +02:00
Britta Weber ac5701968b Fix mapping creation on bulk request
When a bulk request triggers an index creation a mapping might not be
created. The reason is that when indexing documents in a bulk,
an indexing operation might fail due to a shard not yet being
started. The mapping service, however, might already
have the mapping but the mapping update is never issued to the master,
even on subsequent indexing of documents.

Instead, the mapping must be propagated to master even if the
indexing fails due to a shard not being started.

closes #5623
2014-04-02 13:53:44 +02:00
Shay Banon 63290a910e Freq Terms Enum
A frequency caching terms enum, that also allows to be configured with an optional filter. To be used by both significant terms and phrase suggester.
This change extracts the frequency caching into the same code, and allow in the future to add a filter to control/customize the background frequencies
Closes #5597
2014-04-02 11:16:00 +01:00
Boaz Leskes 285fa16f62 [Tests] Reduce the number of threads used by the BackgroundIndexer by default
It sometimes overloads the nodes.
2014-04-02 11:02:38 +02:00
Martijn van Groningen d57ef1e0d6 Removed incorrect comment 2014-04-02 12:14:35 +07:00
Martijn van Groningen b7451533c8 Added an indices level field data cache listener that always gets invoked and updates indices statistics and services about field data loading and unloading.
Moved the circuit breaker memory reducing logic to the IndicesFieldDataCacheListener, so it always reduces the memory used when field data gets unloaded,
this fixes a issue where the circuit breaker didn't get reduced when segments where no shardId could be resolved get cleared up.

Also made sure that exceptions in the percolator service are bubbled up properly.

Closes #5588
2014-04-02 11:55:45 +07:00
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