Commit Graph

14877 Commits

Author SHA1 Message Date
Clinton Gormley 9da8822aed Docs: Made multi-fields more prominent 2015-08-06 20:09:42 +02:00
Adrien Grand 00093a21dc Merge pull request #12294 from jpountz/fix/multi_match_boost
`multi_match` query applies boosts too many times.
2015-08-06 19:07:44 +02:00
Adrien Grand 8d5fff37ae `multi_match` query applies boosts too many times.
The `multi_match` query groups terms that have the same analyzer together and
then applies the boost of the first query in each group. This is not necessary
given that boosts for each term are already applied another way.
2015-08-06 19:07:12 +02:00
Clinton Gormley 0eb2ab915d Docs: Fixed date format default option 2015-08-06 19:05:09 +02:00
Christoph Büscher 88fe42bc50 Tests: Allow unmapped fields in SimpleQueryStringBuilderTest#testDefaultOperatorHandling 2015-08-06 19:05:00 +02:00
Clinton Gormley 08687dfa3d Docs: Fixed typo on string datatype page 2015-08-06 18:59:37 +02:00
Clinton Gormley 52663071c0 Docs: Removed redundant docs from field datatypes page. 2015-08-06 18:52:54 +02:00
Adrien Grand b59918f29d Merge pull request #12695 from jpountz/enhancement/script_needs_scores
Allow scripts to expose whether they use the `_score`.
2015-08-06 18:47:18 +02:00
Clinton Gormley 7977979146 Docs: Reorganised the mapping home page 2015-08-06 18:44:07 +02:00
Robert Muir d61d775f19 Merge pull request #12696 from rmuir/better_jvm_check_error
Improve jvmcheck error failure
2015-08-06 12:35:55 -04:00
Robert Muir 1ca97934b5 Improve jvmcheck error failure
Versions can be tricky with linux vendors and such. To help debug any possible issues, we should output a better version.

Today:
```
[elasticsearch] java.lang.RuntimeException: Java version: 1.7.0_55 suffers from critical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause data corruption.
[elasticsearch] Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations.
[elasticsearch] If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JAVA_OPTS environment variable.
[elasticsearch] Upgrading is preferred, this workaround will result in degraded performance.
[elasticsearch]     at org.elasticsearch.bootstrap.JVMCheck.check(JVMCheck.java:121)
[elasticsearch]     at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:270)
[elasticsearch]     at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:28)
```

With patch:
```
java.lang.RuntimeException: Java version: Oracle Corporation 1.7.0_40 [Java HotSpot(TM) 64-Bit Server VM 24.0-b56] suffers from critical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause data corruption.
Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations.
If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JAVA_OPTS environment variable.
Upgrading is preferred, this workaround will result in degraded performance.
	at org.elasticsearch.bootstrap.JVMCheck.check(JVMCheck.java:121)
	at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:270)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:28)
```
2015-08-06 12:22:04 -04:00
Lee Hinman 0a1c9de075 Merge remote-tracking branch 'dakrone/avoid-extra-reroutes-FP' 2015-08-06 10:07:41 -06:00
Clinton Gormley 666fe4d6a5 Docs: Date-math should be on common options 2015-08-06 17:49:30 +02:00
Adrien Grand b16e2d95af Allow scripts to expose whether they use the `_score`.
This commit adds a new API to allow scripts to say whether they need scores.
In practice, only the `expression` script engine makes use of it correctly,
other engines just return `true` since they can't predict whether they'll
need scores. This should make scripted aggregations and `function_query`
faster as we'll now be able to pass needsScores=false to Query.createWeight.
2015-08-06 17:25:51 +02:00
Clinton Gormley ac2b8951c6 Docs: Mapping docs completely rewritten for 2.0 2015-08-06 17:24:51 +02:00
Jason Tedor 40cd460647 Merge pull request #12691 from jasontedor/fix/12683
Do not track named queries that are null
2015-08-06 09:33:29 -04:00
Jason Tedor e5786d2d82 Do not track named queries that are null
Adding a named query that is null can lead to a NullPointerException
when copying the named queries. This is due to an implementation detail
in QueryParseContent.copyNamedQueries. In particular, this method uses
com.google.common.collect.ImmutableMap.copyOf. A documented requirement
of ImmutableMap is that none of the entries have a null key nor null
value. Therefore, we should not add such queries to the namedQueries
map. This will not change any behavior since Map.get returns null if no
entry with the given key exists anyway.

Closes #12683
2015-08-06 09:31:51 -04:00
Adrien Grand 8590fa49a6 Merge pull request #12693 from jpountz/enhancement/speed_up_function_score_query_when_replacing_score
Speed up the `function_score` query when scores are not needed.
2015-08-06 15:14:44 +02:00
javanna 20f944bf94 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/common/io/stream/FilterStreamInput.java
	core/src/main/java/org/elasticsearch/common/io/stream/NamedWriteableRegistry.java
	core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java
	core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java
	core/src/main/java/org/elasticsearch/transport/netty/MessageChannelHandler.java
	core/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java
	core/src/test/java/org/elasticsearch/transport/AbstractSimpleTransportTests.java
2015-08-06 15:09:14 +02:00
Adrien Grand 23a3db8bb6 Speed up the `function_score` query when scores are not needed.
This change improves the `function_score` query to not compute scores at all
when they are not needed, and to not compute scores on the underlying query
when the combine function is to replace the score with the scores of the
functions.
2015-08-06 15:04:48 +02:00
Robert Muir 57b1b72af6 Factor out waiting for easier redefinition 2015-08-06 08:28:08 -04:00
javanna 6f13171d50 [TEST] add NamedWriteableRegistry argument to AbstractSimpleTransportTests#build method 2015-08-06 12:56:28 +02:00
javanna 63d18d5e05 Make FilterInputStream abstract 2015-08-06 12:55:57 +02:00
javanna e1e9e1a6e1 Transport: allow to de-serialize arbitrary objects given their name
This commit makes it possible to serialize arbitrary objects by having them extend Writeable. When reading them though, we need to be able to identify which object we have to create, based on its name. This is useful for queries once we move to parsing on the coordinating node, as well as with aggregations and so on.

Introduced a new abstraction called NamedWriteable, which is supported by StreamOutput and StreamInput through writeNamedWriteable and readNamedWriteable methods. A new NamedWriteableRegistry is introduced also where named writeable prototypes need to be registered so that we are able to retrieve the proper instance of the writeable given its name and then de-serialize it calling readFrom against it.

Closes #12393
2015-08-06 12:25:27 +02:00
Christoph Büscher b763265f67 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/transport/local/LocalTransport.java
2015-08-06 11:14:04 +02:00
Simon Willnauer d0abffc9ac Add unittest for DiskThresholdDecider#getShardSize / #sizeOfRelocatingShards
This commit adds a basic unittest for the shard size routines and simplifies
some object creation.
2015-08-06 10:35:12 +02:00
Robert Muir 3f7e9d2dc6 Merge pull request #12681 from rmuir/improve_integ2
Get plugin smoketester running in jenkins.
2015-08-05 22:33:53 -04:00
Robert Muir 0ecd7b8ccf Merge pull request #12668 from rmuir/configure_script
Add path.scripts directory
2015-08-05 22:33:30 -04:00
Robert Muir 354a32b05d remove annoying maven warning 2015-08-05 22:08:12 -04:00
Robert Muir 5fe49e4420 cleanup skipping everywhere 2015-08-05 21:45:09 -04:00
Robert Muir c62f0655d3 fix/cleanup pidfile stuff 2015-08-05 20:34:24 -04:00
Robert Muir 15e5247e03 Get plugin smoketester running in jenkins.
We have a smoke_test_plugins.py, but its a bit slow, not integrated
into our build, etc.

I converted this into an integration test. It is definitely uglier
but more robust and fast (e.g. 20 seconds time to verify).

Also there is refactoring of existing integ tests logic, like printing
out commands we execute and stuff
2015-08-05 20:24:36 -04:00
Lee Hinman 437c43cd7f Avoid extra reroutes of delayed shards in RoutingService
In order to avoid extra reroutes, `RoutingService` should avoid
scheduling a reroute of any shards where the delay is negative. To make
sure that we don't encounter a race condition between the
GatewayAllocator thinking a shard is delayed and RoutingService thinking
it is not, the GatewayAllocator will update the RoutingService with the
last time it checked in order to use a consistent "view" of the delay.

Resolves #12456
Relates to #12515 and #12456
2015-08-05 14:59:31 -06:00
Nik Everett 69be7f77fc Prevent DirectCandidateGenerator to reuse an unclosed analyzer
When postFilter generates a token that is identical to the input term
DirectCandidateGenerator should not preFilter this token. If postFilter
and preFilter are the same analyzer instance it would fail with :
"TokenStream contract violation: close() call missing"

This is a forward port of @nomoa's #12670
2015-08-05 15:30:13 -04:00
Simon Willnauer 0b9729af5b Use explict flag if index should be created on engine creation
Today we try to detect if there is an index existing in the directory
and if not we create one. This can be tricky and errof prone since we
rely on the filesystem without taking the context into account when the
engine gets created. We know in all situations if the index should be created
so we can just use this infromation and rely on the lucene index writer to barf
if we hit a situations where we can't append to an index while we should.
2015-08-05 20:44:56 +02:00
Simon Willnauer abf763c1c5 Rethrow exception during recovery finalization even if source if not broken
Today we miss to throw / rethrow an recovery exception if it happens during
the finalization of phase 1 if the source files are not affected. Even worse
this can cause some dataloss if the reason for this exception is a failure of
deleting a corruption marker or similar pre-existing corruptions since we continue
with the recovery and mark the target shared as started which will in-turn open
an engine with an empty index.
2015-08-05 20:44:10 +02:00
Nik Everett 065275443d Merge pull request #12535 from nik9000/fix/9732
Improve toString on EsThreadPoolExecutor
2015-08-05 14:29:55 -04:00
Nik Everett 804f14c68e Core: Remove nasty hack in toString
This makes the output of EsThreadPoolExecutor#toString less pretty but
we no longer have funky hacky that rely on the specific format of the
toString produced by ThreadPoolExecutor which isn't part of its API and
could change with any JVM version and break the output.
2015-08-05 13:57:28 -04:00
Nik Everett ed7d84ca5f Core: Improve toString on EsThreadPoolExecutor
Improving the toString allows for nicer error reporting. Also cleaned up
the way that EsRejectedExecutionException notices that it was rejected
from a shutdown thread pool. I left javadocs about how its not 100% correct
but good enough for most uses.

The improved toString on EsThreadPoolExecutor mean every one of them needs
a name. In most cases the name to use is obvious. In tests I use the name
of the test method and in real thread pools I use the name of the thread
pool. In non-ThreadPool executors I use the thread's name.

Closes #9732
2015-08-05 13:57:28 -04:00
Nik Everett d46fdb1638 [Tests] Cleanup EsExecutorsTests
* names prefixed with test don't need @Test
* Javadoc describing what it tests
2015-08-05 13:56:58 -04:00
Christoph Büscher 07c2e48e96 Merge pull request #12527 from cbuescher/feature/query-refactoring-queryCreationContext
Separating QueryParseContext and QueryShardContext
2015-08-05 16:24:50 +02:00
Alexander Reelsen 5a701367a7 PluginManager: Add Support for basic auth
In order to support the URL notation including a user/pass combination
(like http://user:pass@host/plugin.zip) the auth info needs to be added
manually.
2015-08-05 15:56:42 +02:00
Christoph Büscher 904cbf5340 Separating QueryParseContext and QueryShardContext
We are currently splitting the parse() method in the query parsers into a
query parsing part (fromXContent(QueryParseContext)) and a new method that
generates the lucene query (toQuery(QueryParseContext)). At some point we
would like to be able to excute these two steps in different phases, one
on the coordinating node and one on the shards.

This PR tries to anticipate this by renaming the existing QueryParseContext
to QueryShardContext to make it clearer that this context object will provide
the information needed to generate the lucene queries on the shard. A new
QueryParseContext is introduced and all the functionality needed for parsing
the XContent in the request is moved there (parser, helper methods for parsing
inner queries).

While the refactoring is not finished, the new QueryShardContext will expose the
QueryParseContext via the parseContext() method. Also, for the time beeing the
QueryParseContext will contain a link back to the QueryShardContext it wraps, which
eventually will be deleted once the refactoring is done.

Closes #12527
Relates to #10217
2015-08-05 15:45:43 +02:00
Clinton Gormley 60f8fa4451 Added pure perl fallback for Digest::SHA for old windows boxes 2015-08-05 13:58:18 +02:00
Alexander Reelsen da31fbe702 Testing: Removing leftover @AwaitsFix annotation
Since the update to HDRHistogram 2.1.6 this test was
forgotten to get the annotation removed in #12554.
2015-08-05 13:47:28 +02:00
Robert Muir d7d25fe6b5 Add path.scripts directory
Today this is "unofficial" as conf/scripts, but some people
want to share scripts across different nodes and so on. Because
they cannot configure it, they are forced to use dirty hacks
like symbolic links, which isnt going to work: we aren't going
to recursively scan conf/ and add permissions to all link targets
underneath it, thats crazy.

I really hate adding yet another configuration knob here, but
users resorting to using symlinks are going to be frustrated,
and do things in a more insecure way.
2015-08-05 06:45:52 -04:00
Alexander Reelsen 88842f3319 PluginManager: Fix elastic.co download URLs, add snapshot ones
The URL to download the main elasticsearch plugins did not match
what the S3 wageon is supposed to write to.

In addition this PR adds support for snapshots to access the
snapshot S3 bucket, so we can possibly download snapshot versions
of plugins.

The format of the URLs stems from #12270

Closes #12632
2015-08-05 11:46:20 +02:00
Christoph Büscher 2784e2f7f0 Merge branch 'master' into feature/query-refactoring 2015-08-05 11:07:12 +02:00
Clinton Gormley 0b0846f84b Updated multi-match-query.asciidoc
Corrected note about which field is boosted in a cross-fields multi_match query.

Relates to #12294
2015-08-05 10:52:56 +02:00
Alexander Reelsen 9028fb8fbe Release: Update build release script to reflect latest changes
As the script now deploys to S3 and several things in master have
changed, this script needs to reflect the latest changes

* An unsigned RPM is built by default, so that users of older
  RPM based distros can download and use that RPM by default
* In addition a signed RPM is built, that is used for the repositories
* Paths for the new distributions have been fixed
* The check for the number of jars has been removed, as this is done
  as part of the license checking in `mvn verify`
* Checksum generation has been removed, as this is done as part of the
  mvn build
* Publishing artifacts of S3 has been removed
* Repostitory creation script has been updated
2015-08-05 09:38:42 +02:00