Commit Graph

11870 Commits

Author SHA1 Message Date
Shay Banon b2e022bd94 Merge pull request #10924 from kimchy/exclude_jackson_ann
Exclude jackson-databind dependency
2015-05-01 19:09:35 +02:00
Shay Banon 16c7689355 Exclude jackson-databind dependency
the jackson yaml data format pulls in the databind dependency, its important that we exclude it so we won't use any of its classes by mistake
2015-05-01 19:03:14 +02:00
Robert Muir c15f3eff3a Merge branch 'die_cwd_die' of github.com:elastic/elasticsearch 2015-05-01 12:06:02 -04:00
Robert Muir 260f5eb9ff Merge pull request #10913 from rmuir/spanspanspanspanspan
Add span within/containing queries.
2015-05-01 11:26:08 -04:00
Robert Muir dfe1d1463c fix doc typo 2015-04-30 23:46:37 -04:00
Robert Muir aade6194b7 Add span within/containing queries.
Expose new span queries from https://issues.apache.org/jira/browse/LUCENE-6083

Within returns matches from 'little' that are enclosed inside of a match from 'big'.
Containing returns matches from 'big' that enclose matches from 'little'.
2015-04-30 23:31:31 -04:00
Igor Motov c165afb4d5 Logging: Add logging of slow cluster state tasks
Closes #10874
2015-04-30 19:13:49 -04:00
Jack Conradson aa968f6b65 Scripting: Add Field Methods
Added infrastructure to allow basic member methods in the expressions
language to be called.  The methods must have a signature with no arguments.  Also
added the following member methods for date fields (and it should be easy to add more)
* getYear
* getMonth
* getDayOfMonth
* getHourOfDay
* getMinutes
* getSeconds

Allow fields to be accessed without using the member variable [value].
(Note that both ways can be used to access fields for back-compat.)

closes #10890
2015-04-30 15:36:46 -07:00
Ryan Ernst d2b12e4fc2 Mappings: Remove docs for type level analyzer defaults
These settings were removed in #9430.
2015-04-30 13:57:55 -07:00
Ryan Ernst 4ef9f3ca63 Mappings: Remove file based default mappings
Using files that must be specified on each node is an anti-pattern
from the API based goal of ES. This change removes the ability
to specify the default mapping with a file on each node.

closes #10620
2015-04-30 13:50:35 -07:00
Ryan Ernst a0451a37cc Upgrade lucene snapshot to r1677039 2015-04-30 13:43:19 -07:00
Boaz Leskes d596f5cc45 Decouple recoveries from engine flush
In order to safely complete recoveries / relocations we have to keep all operation done since the recovery start at available for replay. At the moment we do so by preventing the engine from flushing and thus making sure that the operations are kept in the translog. A side effect of this is that the translog keeps on growing until the recovery is done. This is not a problem as we do need these operations but if the another recovery starts concurrently it may have an unneededly long translog to replay. Also, if we shutdown the engine for some reason at this point (like when a node is restarted)  we have to recover a long translog when we come back.

To void this, the translog is changed to be based on multiple files instead of a single one. This allows recoveries to keep hold to the files they need while allowing the engine to flush and do a lucene commit (which will create a new translog files bellow the hood).

Change highlights:
- Refactor Translog file management to allow for multiple files.
- Translog maintains a list of referenced files, both by outstanding recoveries and files containing operations not yet committed to Lucene.
- A new Translog.View concept is introduced, allowing recoveries to get a reference to all currently uncommitted translog files plus all future translog files created until the view is closed. They can use this view to iterate over operations.
- Recovery phase3 is removed. That phase was replaying operations while preventing new writes to the engine. This is unneeded as standard indexing also send all operations from the start of the recovery  to the recovering shard. Replay all ops in the view acquired in recovery start is enough to guarantee no operation is lost.
- IndexShard now creates the translog together with the engine. The translog is closed by the engine on close. ShadowIndexShards do not open the translog.
- Moved the ownership of translog fsyncing to the translog it self, changing the responsible setting to `index.translog.sync_interval` (was `index.gateway.local.sync`)

Closes #10624
2015-04-30 23:42:50 +03:00
Adrien Grand 12c19508fb Tests: Fix test bug in aggregations' EquivalenceTests due to the change of the default min_doc_count. 2015-04-30 19:14:56 +02:00
Martijn van Groningen 7a6fe809d0 inner_hits: Don't use bitset cache for children filters.
Only parent filters should use bitset filter cache, to avoid memory being wasted.
Also in case of object fields inline the field name into the nested object,
instead of creating an additional (dummy) nested identity.

Closes #10662
Closes #10629
2015-04-30 16:56:43 +02:00
Adrien Grand 82ad074dfe Merge pull request #10904 from jpountz/enhancement/histogram_min_doc_count_0
Aggs: Change the default `min_doc_count` to 0 on histograms.
2015-04-30 15:54:02 +02:00
Adrien Grand e5be85d586 Aggs: Change the default `min_doc_count` to 0 on histograms.
The assumption is that gaps in histogram are generally undesirable, for instance
if you want to build a visualization from it. Additionally, we are building new
aggregations that require that there are no gaps to work correctly (eg.
derivatives).
2015-04-30 15:48:23 +02:00
Colin Goodheart-Smithe 969f53e399 fix typo in Min bucket aggregation docs 2015-04-30 14:41:01 +01:00
Colin Goodheart-Smithe d16bf992a9 Aggregations: min_bucket aggregation
An aggregation to calculate the minimum value in a set of buckets.

Closes #9999
2015-04-30 13:34:21 +01:00
javanna 77ac4528fb Transport: read/writeGenericValue to support BytesRef
Add support for BytesRef to existing StreamInput#readGenericValue and StreamOutput#writeGenericValue

Closes #10878
2015-04-30 10:59:01 +02:00
Ryan Ernst 2fd387d378 fix dumb test copy/paste mistake 2015-04-29 23:33:43 -07:00
Ryan Ernst 79a1c38ed6 Mappings: Fix _field_names to not have doc values
When doc values were turned on a by default, most meta fields
had it explicitly disabled.  However, _field_names was missed.
This change forces doc values to be off always for _field_names
and removes the unnecessary support when creating index fields.

closes #10892
2015-04-29 23:12:16 -07:00
Ryan Ernst d8fed71fd4 Merge branch 'master' into die_cwd_die 2015-04-29 16:48:13 -07:00
Ryan Ernst 5236a3d226 fix some tests, all fast tests now pass 2015-04-29 16:32:54 -07:00
Zachary Tong 351a4d3315 [DOCS] Fix movavg images and naming 2015-04-29 13:33:54 -04:00
Igor Motov 8e5543dea0 Test: ignore cluster state differences on the nodes that disconnected from the master 2015-04-29 12:49:41 -04:00
Igor Motov bac135261c Test: make sure that tests are not affected by changing in address resolution settings 2015-04-29 12:49:40 -04:00
Igor Motov 38be1e8a1a Test: remove reference to the local node before comparing cluster states in ensureClusterStateConsistency 2015-04-29 12:49:40 -04:00
Simon Willnauer 9828e955f3 [TEST] enable host name resolving to gain consistent transport addresses in clusterstate 2015-04-29 12:49:40 -04:00
Simon Willnauer 58eed45ee5 [TEST] Move XContentTestUtils.java into o.e.test folder
Classes referenced by the Test base classes must be under this
package otherwise the test jar can't be used in a 3rd party application.
2015-04-29 12:49:40 -04:00
Igor Motov 478c253f89 Add support for cluster state diffs
Adds support for calculating and sending diffs instead of full cluster state of the most frequently changing elements - cluster state, meta data and routing table.

Closes #6295
2015-04-29 12:49:40 -04:00
Lee Hinman 6e1c995741 Clarify logging about disk thresholds in DiskThresholdDecider 2015-04-29 10:43:00 -06:00
David Pilato 3c3e9b63a7 fix: query string time zone not working
If you define exactly the same date range query using either `DATE+0200` notation or `DATE` and set `timezone: +0200`, elasticsearch gives back different results:

```
DELETE foo
PUT /foo
{
  "mapping": {
    "tweets": {
      "properties": {
        "tweet_date": {
          "type": "date"
        }
      }
    }
  }
}

POST /foo/tweets/1/
{
  "tweet_date": "2015-04-05T23:00:00+0000"
}
POST /foo/tweets/2/
{
  "tweet_date": "2015-04-06T00:00:00+0000"
}

GET /foo/tweets/_search?pretty
{
    "query": {
        "query_string": {
            "query": "tweet_date:[2015-04-06T00:00:00+0200 TO 2015-04-06T23:00:00+0200]"
        }
    }
}
GET /foo/tweets/_search?pretty
{
    "query": {
        "query_string": {
            "query": "tweet_date:[2015-04-06T00:00:00 TO 2015-04-06T23:00:00]",
            "time_zone": "+0200"
        }
    }
}
```

This PR fixes it and will also allow us to add the same feature to simple_query_string as well in another PR.

Closes #10477.

(cherry picked from commit 880f4a0)
2015-04-29 18:10:02 +02:00
Simon Willnauer d4463602f6 [TEST] Use a high shard delete timeout when clusterstates are delayed
`IndiceStore#indexCleanup` uses a disruption scheme to delay cluster state
processing. Yet, the delay is [1..2] seconds but tests are setting the shard
deletion timeout to 1 second to speed up tests. This can cause random not
reproducible failures in this test since the timeouts and delays are bascially
overlapping. This commit adds a longer timeout for this test to prevent these
problems.
2015-04-29 17:51:21 +02:00
Colin Goodheart-Smithe 02c0cdff0a Aggregations: Ability to perform computations on aggregations
Adds a new type of aggregation called 'reducers' which act on the output of aggregations and compute extra information that they add to the aggregation tree. Reducers look much like any other aggregation in the request but have a buckets_path parameter which references the aggregation(s) to use.

Internally there are two types of reducer; the first is given the output of its parent aggregation and computes new aggregations to add to the buckets of its parent, and the second (a specialisation of the first) is given a sibling aggregation and outputs an aggregation to be a sibling at the same level as that aggregation.

This PR includes the framework for the reducers, the derivative reducer (#9293), the moving average reducer(#10002) and the maximum bucket reducer(#10000). These reducer implementations are not all yet fully complete.

Known work left to do (these points will be done once this PR is merged into the master branch):

Add x-axis normalisation to the derivative reducer
Add lots more JUnit tests for all reducers
Contributes to #9876
Closes #10002
Closes #9293
Closes #10000
2015-04-29 16:35:49 +01:00
Colin Goodheart-Smithe 0589adb8b4 Merge branch 'master' into feature/aggs_2_0
# Conflicts:
#	src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java
2015-04-29 16:32:05 +01:00
javanna eb44e950d4 Java Api: remove unused private static class PartialField from SearchSourceBuilder
Partial fields have been removed from master a while ago, this is a leftover.
2015-04-29 17:26:32 +02:00
Colin Goodheart-Smithe 88aa8934a3 Merge branch 'master' into feature/aggs_2_0 2015-04-29 16:10:19 +01:00
Britta Weber a202c2a434 Revert "Write state also on data nodes if not master eligible"
This reverts commit 4088dd38cb.
2015-04-29 17:07:07 +02:00
Colin Goodheart-Smithe a33e77ff96 Muted intermittently failing tests
To reproduce the failures use `-Dtests.seed=D9EF60095522804F`
2015-04-29 16:04:29 +01:00
Igor Motov 9b76be92b3 Docs: add notes about using close and awaitClose with bulk processor
Closes #10839
2015-04-29 10:53:16 -04:00
Colin Goodheart-Smithe 57a8885964 Merge branch 'master' into feature/aggs_2_0
# Conflicts:
#	src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java
#	src/main/java/org/elasticsearch/search/aggregations/AggregationModule.java
#	src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java
#	src/main/java/org/elasticsearch/search/aggregations/AggregatorParsers.java
#	src/main/java/org/elasticsearch/search/aggregations/InternalMultiBucketAggregation.java
#	src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java
#	src/main/java/org/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java
#	src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTest.java
2015-04-29 15:49:41 +01:00
Robert Muir 9dec558ea1 nuke more cwd usage 2015-04-29 10:43:11 -04:00
markharwood 528f6481ea Query enhancement: return positions of parse errors found in JSON
Extend SearchParseException and QueryParsingException to report position information in query JSON where errors were found. All query DSL parser classes that throw these exception types now pass the underlying position information (line and column number) at the point the error was found.

Closes #3303
2015-04-29 15:02:46 +01:00
Adrien Grand 6e076efdb9 Docs: Add documentation for the `doc_values` setting on the `boolean` field type.
Close #10431
2015-04-29 15:59:24 +02:00
Colin Goodheart-Smithe 3bb8ff2a92 fixed issue with eggs in percolation request for 1 shard 2015-04-29 14:55:20 +01:00
javanna 1d4df4b628 [TEST] remove source parameter validation from REST tests runner
source parameter is implicitly supported and doesn't need to be declared in rest spec. It is tested though, as every api that supports get with body can also get requests using POST with body or get with source query_string parameter.
2015-04-29 15:44:43 +02:00
Robert Muir c0587cb244 fix CWD usage in analysis tests 2015-04-29 09:44:37 -04:00
Britta Weber 4088dd38cb Write state also on data nodes if not master eligible
When a node was a data node only then the index state was not written.
In case this node connected to a master that did not have the index
in the cluster state, for example because a master was restarted and
the data folder was lost, then the indices were not imported as dangling
but instead deleted.
This commit makes sure that index state for data nodes is also written
if they have at least one shard of this index allocated.

closes #8823
closes #9952
2015-04-29 15:27:21 +02:00
Robert Muir 6bd69b74f1 Merge branch 'master' into die_cwd_die 2015-04-29 09:15:18 -04:00
Adrien Grand ccca0386ef Other indentation fixes 2015-04-29 15:14:23 +02:00