Commit Graph

7649 Commits

Author SHA1 Message Date
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
Alexander Reelsen 4fc461a97c [DOCS] Moved the template query documentation into search section 2014-03-25 10:01:41 +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 b4e504df99 [Docs] Add coming tag for context suggester docs 2014-03-25 09:46:49 +01:00
Simon Willnauer 13109d3547 [Build] splitted release commits into version and feature flag commits
Elasticsearch is release from release-branches but the modifications
to the documentation must be cherry-picked into the current development
branch. To make this easier this commit splits the commits of the
Version and the documenation into seperate commits.
2014-03-25 09:16:34 +01:00
Igor Motov 3414deb215 [DOCS] Mark snapshot status API as coming in 1.1.0 2014-03-24 21:55:19 -04: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
Bill Hwang 703f374a8a Add 1.1 branch url
Added S3 access URL for elasticsearch 1.1 snapshot
2014-03-24 10:16:41 -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 09e5ac98fa [TEST] Don't use replicas if only primaries are expected or the first shard in the list shoudl be a primary 2014-03-22 18:36:34 +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
Clinton Gormley ec8f404ac7 Renamed spec search.template.json to search_template.json
to match the name of the method.
2014-03-21 13:42:52 +01:00
javanna 70c9d6f3bd [TEST] added missing wait for yellow to indices recovery REST test 2014-03-21 10:24:07 +01:00
Jun Ohtani 20e596cb86 fix typo joda-time link 2014-03-21 10:02:53 +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
Honza Král ed842a88da [API] renaming search-template to search_template.
Name of the API should be a valid identifier.
2014-03-20 21:58:08 +01: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 bea0dd7c75 [TEST] Fix cat.recovery/10_basic.yaml to allow '-' in the hostname 2014-03-20 20:58:58 +01:00
Simon Willnauer 30532410bf [TEST] disable cat.recovery/10_basic.yaml 2014-03-20 20:43:17 +01:00
Simon Willnauer 6b5001891f [TEST] Added skip clause for regexp feature 2014-03-20 20:41:20 +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
Simon Willnauer 876b2592ac [Build] Skip topN hints if tests are skipped 2014-03-20 12:45:35 +01:00