Commit Graph

12220 Commits

Author SHA1 Message Date
Igor Motov 3db9caf7a1 Tests: Increase timeout waiting for snapshot to complete in batchingShardUpdateTaskTest
When this test picks a large number of shards, the snapshot doesn't always manage to complete in 10 seconds.
2015-05-28 08:56:30 -10:00
Lee Hinman 5a73a16355 Merge branch 'pr/10896' 2015-05-28 12:32:33 -06:00
Igor Motov d955461f58 Tests: fix NPE in UpgradeTest 2015-05-28 07:25:00 -10:00
jaymode f732900111 Export hostname as environment variable for plugin manager
In #9474, we exported the hostname in the bin/elasticsearch scripts so that it
could be used as a variable in the elasticsearch.yml file but did not do the same
for plugin manager. When using the hostname variable in elasticsearch.yml and
trying to use the plugin manager, initialization will fail because the property could
not be resolved. This change will allow the hostname to be resolved in the same
manner as the service scripts.

Closes #10902
2015-05-28 13:03:30 -04:00
Igor Motov 55fc3a727b Core: refactor upgrade API to use transport and write minimum compatible version that the index was upgraded to
In #11072 we are adding a check that will prevent opening of old indices. However, this check doesn't take into consideration the fact that indices can be made compatible with the current version through upgrade API. In order to make compatibility check aware of the upgrade, the upgrade API should write a new setting `index.version.minimum_compatible` that will indicate the minimum compatible version of lucene this index is compatible with and `index.version.upgraded` that will indicate the version of elasticsearch that performed the upgrade.

Closes #11095
2015-05-28 05:23:49 -10:00
Alexander Reelsen 38639074b4 Testing: Ensure cat API REST tests are unaffected by randomization
The wildcard cat API REST tests relied on bulk.max and bulk.min in
the thread_pool response. However due to the thread pool types being
randomized in InternalTestCluster, the min/max values were not guaranteed
to exist (the cached thread pool type is unbounded and thus does not have a
max value).

In order to prevent this, the test has been removed and now the cat
nodes test is used for wildcard testing, which always returns stats
about the heap.
2015-05-28 16:24:41 +02:00
Simon Willnauer a4c88b7233 Consolidate directory lock obtain code
The Directory#makeLock API is trappy and can easily lead to unexpected
lock release if native locks are used. see LUCENE-6507 for details.
This commit consolidates the lock lock into one place and only returns
the lock instance if we actually acquired it.
2015-05-28 16:05:11 +02:00
markharwood 283b0931ff Aggregations fix: queries with size=0 broke aggregations that require scores.
Aggregations like Sampler and TopHits that require access to scores did not work if the query has size param set to zero. The assumption was that the Lucene query scoring logic was not required in these cases.
Added a Junit test to demonstrate the issue and a fix which relies on earlier creation of Collector wrappers so that Collector.needsScores() calls work for all search operations.

Closes #11119
2015-05-28 14:45:23 +01:00
jaymode 105f4dd512 Test: filter out colons in test section names
On Windows, colons ':' are illegal in file names and since we use a Path to
check if the test is blacklisted, tests with a colon in the test section name
will fail. This change simply removes the colon from the name when matching
against the blacklist.
2015-05-28 06:39:51 -04:00
Britta Weber 91e9caabd7 [TEST] add path.home to settings 2015-05-28 11:54:56 +02:00
Britta Weber 334763acef Merge pull request #10909 from aleph-zero/issues/9706
Read configuration file with .yaml suffix
2015-05-28 11:54:05 +02:00
javanna 2f57ae9345 Internal: deduplicate field names returned by `simpleMatchToFullName` & `simpleMatchToIndexNames` in FieldMappersLookup
Relates to #10916
Closes #11377
2015-05-28 09:14:39 +02:00
Zachary Tong d32a80f37b Docs: Fix misplaced images in moving_avg docs 2015-05-27 16:13:36 -04:00
jaymode 6d96bfc98b catch UnsatisfiedLinkError on JNA load
This catches UnsatifiedLinkError when attempting to load the JNA Native
class, in cases where there are error loading the native libraries that JNA
needs to function.
2015-05-27 15:26:30 -04:00
Zachary Tong 5acb40ca26 Merge pull request #11043 from polyfractal/feature/aggs_holtwinters
Aggregations: Add Holt-Winters model to `moving_avg` pipeline aggregation
2015-05-27 14:49:39 -04:00
Zachary Tong 491afbe01c Aggregations: Add Holt-Winters model to `moving_avg` pipeline aggregation
Closes #11043
2015-05-27 14:45:45 -04:00
Clinton Gormley cbb7b633f6 REST tests: Fixed bad YAML in search/10_source_filtering 2015-05-27 19:35:00 +02:00
jaymode e54dd688a1 make JNA optional for tests and move classes to bootstrap package
Today, JNA is a optional dependency in the build but when running tests or running
with mlockall set to true, JNA must be on the classpath for Windows systems since
we always try to load JNA classes when using mlockall.

The old Natives class was renamed to JNANatives, and a new Natives class is
introduced without any direct imports on JNA classes. The Natives class checks to
see if JNA classes are available at startup. If the classes are available the Natives
class will delegate to the JNANatives class. If the classes are not available the
Natives class will not use the JNANatives class, which results in no additional attempts
to load JNA classes.

Additionally, all of the JNA classes were moved to the bootstrap package and made
package private as this is the only place they should be called from.

Closes #11360
2015-05-27 13:06:23 -04:00
Colin Goodheart-Smithe 95faa35853 Aggregations: Sibling Pipeline Aggregations can now be nested in SingleBucketAggregations
Closes #11379
2015-05-27 17:35:21 +01:00
Tanguy Leroux acb07c72b9 Bulk: throw exception if unrecognized parameter in action/metadata line
Closes #10977
2015-05-27 18:03:58 +02:00
Alexander Reelsen 9d5e789508 Cat API: Do not rely on hashmap for sorted entries
The tests for the recently added added wildcard feature were
relying on order of the hashmap being used, which could be
different.

The implementation now ensures, that the header fields are
parsed in the order they have been added.
2015-05-27 17:46:22 +02:00
Britta Weber ceb0782ebd Merge pull request #11364 from brwe/highlighter-wildcard
Wildcard field names in highlighting should only return fields that can be highlighted
2015-05-27 17:11:50 +02:00
Britta Weber 37610548f8 highlighting: don't fail search request when name of highlighted field contains wildcards
When we highlight on fields using wildcards then fields might match that cannot
be highlighted by the specified highlighter. The whole search request then
failed. Instead, check that the field can be highlighted and ignore the field
if it can't.
In addition ignore the exception thrown by plain highlighter if a field conatins
terms larger than 32766.

closes #9881
2015-05-27 17:10:35 +02:00
markharwood 57653df713 Search fix: fielddata_fields query string parameter was ignored.
The RestSearchAction did not parse the fielddata_fields parameter. Added test case and missing parser code.

Closes #11025
2015-05-27 15:30:10 +01:00
Colin Goodheart-Smithe 7fbd86aa97 Aggregations: Fixed Moving Average prediction to calculate the correct keys
The Moving average predict code generated incorrect keys if the key for the first bucket of the histogram was < 0. This fix makes the moving average use the rounding class from the histogram to generate the keys for the new buckets.

Closes #11369
2015-05-27 15:25:11 +01:00
Alexander Reelsen fc224a0de8 Cat API: Add wildcard support for header names
This adds wildcard support (simple regexes) for specifying header names.
Aliases are supported as well.

Closes #10811
2015-05-27 16:09:31 +02:00
David Pilato 5384e4712a Fix maven assembly warning about using root dir
It's a bad practice in Maven to define `/` as the output dir.
It's better to leave it empty.

See also http://stackoverflow.com/questions/28500401/maven-assembly-plugin-warning-the-assembly-descriptor-contains-a-filesystem-roo
2015-05-27 12:00:12 +02:00
David Pilato 9bb56c0e00 Ignore dependency-reduced-pom.xml even if used in submodules 2015-05-27 12:00:12 +02:00
Tanguy Leroux 340b7ef6ef Add common SystemD file for RPM/DEB package 2015-05-27 11:51:58 +02:00
javanna ee26ab8bb4 Java api: add name setter to delete index template request and make default constructor public for AnalyzeRequest and DeleteIndexTemplateRequest
Closes #8122
Closes #8123
2015-05-27 11:22:37 +02:00
javanna fc28bc73f8 [DOCS] add kopf to site plugins 2015-05-27 10:28:53 +02:00
Ryan Schneider 8ec6bf7340 [DOCS] Update get.asciidoc
Updated to not mislead the reader that the data is actually gone when a document is updated. For example if you have 100GB of docs and update each one you'll only be able to access 100GB of the data, but there would theoretically be 200GB of doc data.

Closes #10375
2015-05-27 10:17:10 +02:00
Boaz Leskes 7451b4708e Simplify Transport*OperationAction names
As a follow up to #11332, this commit simplifies more class names by remove the superfluous Operation:

TransportBroadcastOperationAction -> TransportBroadcastAction
TransportMasterNodeOperationAction -> TransportMasterNodeAction
TransportMasterNodeReadOperationAction -> TransportMasterNodeReadAction
TransportShardSingleOperationAction -> TransportSingleShardAction

Closes #11349
2015-05-27 09:25:58 +03:00
Lee Hinman 6646881bb6 [CORE] Read segment info from latest commit whenever possible
Instead of listing the directory to file the latest segments_N file, we
should re-use the generation/filename from the last commit. This allows
us to avoid potential race conditions on the filesystem as well as
reduce the number of directory listings performed.
2015-05-26 17:07:20 -06:00
Simon Willnauer fcccd45601 Be more lenient in EIT#waitForDocs
The count request now acts like search and barfs if all shards fail
this behavior changed and some tests like RecoveryWhileUnderLoadTests
relied on the lenient behavior of the old count API. This might be
a temporary solution to stop current test failures.

Relates to #11198
2015-05-26 21:39:20 +02:00
javanna 6c81a8daf3 Internal: count api to become a shortcut to the search api
The count api used to have its own execution path, although it would do the same (up to bugs!) of the search api. This commit makes it a shortcut to the search api with size set to 0. The change is made in a backwards compatible manner, by leaving all of the java api code around too, given that you may not want to get back a whole SearchResponse when asking only for number of hits matching a query, also cause migrating from countResponse.getCount() to searchResponse.getHits().totalHits() doesn't look great from a user perspective. We can always decide to drop more code around the count api if we want to break backwards compatibility on the java api, making it a shortcut on the rest layer only.

Closes #9117
Closes #11198
2015-05-26 19:12:11 +02:00
Alexander Reelsen 1fa21a76cf Documentation: Fix elasticsearch documentation build
The commit for closing #11033 was not building the asciidoc
documentation.
2015-05-26 18:16:12 +02:00
Alexander Reelsen 045f01c085 Infra for deprecation logging
Add support for a specific deprecation logging that can be used to turn
on in order to notify users of a specific feature, flag, setting,
parameter, ... being deprecated.

The deprecation logger logs with a "deprecation." prefix logge
(or "org.elasticsearch.deprecation." if full name is used), and outputs
the logging to a dedicated deprecation log file.

Deprecation logging are logged under the DEBUG category. The idea is not to
enabled them by default (under WARN or ERROR) when running embedded in
another application.

By default they are turned off (INFO), in order to turn it on, the
"deprecation" category need to be set to DEBUG. This can be set in the
logging file or using the cluster update settings API, see the documentation

Closes #11033
2015-05-26 17:44:52 +02:00
Michael McCandless 9d1f6f7615 a few more ImmutableSettings -> Settings 2015-05-26 09:54:44 -04:00
javanna 44fe99a3a8 [TEST] make filter_path a default parameter in java rest runner
Closes #11351
2015-05-26 15:34:45 +02:00
Tanguy Leroux 820314db4e Change project.name to project.artifactId in bin/elasticsearch script because of 60519911b4 2015-05-26 15:27:59 +02:00
Alexander Reelsen b465e19e5f Release script: Always check for valid environment
In order to be sure that a release can be executed on the local machine,
the build_release script now checks for environment variables and tries
to execute a  couple of commands.

In order to easily check for a correctly setup environment, you can
run the following commands, which exits early and does not trigger a
release process.

```
python3 dev-tools/build_release.py --check-only
```
2015-05-26 14:43:29 +02:00
Tanguy Leroux ce63590bd6 API: Add response filtering with filter_path parameter
This change adds a new "filter_path" parameter that can be used to filter and reduce the responses returned by the REST API of elasticsearch.

For example, returning only the shards that failed to be optimized:
```
curl -XPOST 'localhost:9200/beer/_optimize?filter_path=_shards.failed'
{"_shards":{"failed":0}}%
```

It supports multiple filters (separated by a comma):
```
curl -XGET 'localhost:9200/_mapping?pretty&filter_path=*.mappings.*.properties.name,*.mappings.*.properties.title'
```

It also supports the YAML response format. Here it returns only the `_id` field of a newly indexed document:
```
curl -XPOST 'localhost:9200/library/book?filter_path=_id' -d '---hello:\n  world: 1\n'
---
_id: "AU0j64-b-stVfkvus5-A"
```

It also supports wildcards. Here it returns only the host name of every nodes in the cluster:
```
curl -XGET 'http://localhost:9200/_nodes/stats?filter_path=nodes.*.host*'
{"nodes":{"lvJHed8uQQu4brS-SXKsNA":{"host":"portable"}}}
```

And "**" can be used to include sub fields without knowing the exact path. Here it returns only the Lucene version of every segment:
```
curl 'http://localhost:9200/_segments?pretty&filter_path=indices.**.version'
{
  "indices" : {
    "beer" : {
      "shards" : {
        "0" : [ {
          "segments" : {
            "_0" : {
              "version" : "5.2.0"
            },
            "_1" : {
              "version" : "5.2.0"
            }
          }
        } ]
      }
    }
  }
}
```

Note that elasticsearch sometimes returns directly the raw value of a field, like the _source field. If you want to filter _source fields, you should consider combining the already existing _source parameter (see Get API for more details) with the filter_path parameter like this:

```
curl -XGET 'localhost:9200/_search?pretty&filter_path=hits.hits._source&_source=title'
{
  "hits" : {
    "hits" : [ {
      "_source":{"title":"Book #2"}
    }, {
      "_source":{"title":"Book #1"}
    }, {
      "_source":{"title":"Book #3"}
    } ]
  }
}
```
2015-05-26 13:51:04 +02:00
javanna 543f572d80 Highlighting: keep track of the original query only in HighlighterContext
We used to keep track of the rewritten query in the highlighter context to support custom rewriting done by our own postings highlighter fork. Now that we rely on lucene implementation, no rewrite happens, we can simply keep track of the original query and simplify code around it.

Closes #11317
2015-05-26 12:45:22 +02:00
Britta Weber 802b7b88fa [TEST] fix epected error message 2015-05-26 11:49:33 +02:00
Britta Weber 7c6869d875 Merge pull request #11303 from brwe/custom_analyzer_name
analyzers: custom analyzers names and aliases must not start with _
2015-05-26 11:44:10 +02:00
Britta Weber eeeb29f900 spell correct and add single quotes 2015-05-26 11:41:19 +02:00
David Pilato 60519911b4 [maven] fix paths for final artifact
We need to define an absolute path (based on `${project.basedir}`) instead of using related paths.
2015-05-26 11:40:57 +02:00
Britta Weber 37782c1745 analyzers: custom analyzers names and aliases must not start with _
closes #9596
2015-05-26 11:38:15 +02:00
Michael McCandless 4334404a20 Don't truncate TopDocs after rescoring
We were previously over-trimming the TopDocs such that you get
size-from hits instead of size, which is wrong when from != 0.

Closes #11127

Closes #11342
2015-05-26 04:43:18 -04:00