Commit Graph

4991 Commits

Author SHA1 Message Date
Britta Weber 352dc19767 Merge pull request #17204 from mstockerl/master
Alias items are not ignored anymore
2016-04-20 11:40:14 +02:00
Adrien Grand ab168996b6 Fix cross type mapping updates for `boolean` fields. #17882
Boolean fields were not handled in `DocumentParser.createBuilderFromFieldType`.
This also improves the logic a bit by falling back to the default mapping of
the given type insteah of hard-coding every case and throws a better exception
than a NPE if no dynamic mappings could be created.

Closes #17879
2016-04-20 09:48:00 +02:00
Adrien Grand f245fc1ccd Automatically upgrade analyzed strings with an analyzer to `text`. #17861
I had stayed away from it until now since the `analyzer` property is supported
on analyzed strings but not on analyzed strings. So th list of supported
properties for the upgrade has been splitted so that we would still fail the
upgrade if setting an analyzer on a not-analyzed string field.

See https://discuss.elastic.co/t/es5-0a1-the-string-type-is-removed-in-5-0-you-should-now-use-either-a-text-or-keyword-field-instead-for-field/47305/7
2016-04-20 08:35:03 +02:00
Ryan Ernst d2c0e81f11 Internal: Remove unused Settings methods taking multiple setting names
The Settings class has an enormous amount of methods with variations of
parameters. This change removes all the methods which take multiple
setting names, which were completely unused.
2016-04-19 16:31:02 -07:00
Nik Everett 249a635ce1 Fix BulkItemResponse.Failure.toString
It was busted and causing intermittent test failures.
2016-04-19 17:39:16 -04:00
Martijn van Groningen 793c6005ee Revert "fix toString"
This reverts commit 935ccb1304.
2016-04-19 23:29:28 +02:00
Martijn van Groningen 935ccb1304 fix toString 2016-04-19 23:27:16 +02:00
Ryan Ernst ef1e1acf3d Merge pull request #17864 from rjernst/dynamic_lookup
Mappings: Fix dynamic check to properly handle parents
2016-04-19 14:25:49 -07:00
Nik Everett 994dbf7578 Short the serialization of the empty TaskId
We plan to change every request so that it can support a parentTaskId.
This shrinks EMPTY_TASK_ID, which will be on every request once that change
is made, from 31 bytes to 9 bytes to 1 byte.
2016-04-19 17:21:11 -04:00
Nik Everett 7d94cc99a7 Remove more PROTOTYPEs from aggregations
Relates to #17085
2016-04-19 15:46:46 -04:00
Nik Everett cd982ade99 [test] Fix random bounds
0 is invalid so we don't generate it any more.
2016-04-19 15:44:45 -04:00
Michael Stockerl addf3bb52d #14944 Remove obsolete hasResponseFromRequest method 2016-04-19 20:23:27 +02:00
Ryan Ernst d68318fb6c Mappings: Fix dynamic check to properly handle parents
This change fixes the lookup during document parsing of whether an
object field is dynamic to handle looking up through parent object
mappers, and also handle when a parent object mapper was created during
document parsing.

closes #17854
2016-04-19 10:56:55 -07:00
Lee Hinman b8899cdb78 Merge remote-tracking branch 'dakrone/allow-bad-json' 2016-04-19 10:02:53 -06:00
Nik Everett c982216dbe Remove PROTOTYPEs from Ranges
Relates to #17085
2016-04-19 11:38:16 -04:00
Nik Everett 133cec602c Migrate (read|write)Query to (read|write)NamedWriteable
Now there aren't any more specialized methods to read or write
NamedWriteables! Now StreamInput and StreamOutput don't need to know
about large chunks of the application!
2016-04-19 11:37:24 -04:00
Nik Everett 339d927ee4 Migrate more functions to (read|write)NamedWriteable
ScoreFunction and Suggestion.
Relates #17682.
2016-04-19 11:35:53 -04:00
Martijn van Groningen ba08313417 settings: Removed `action.get.realtime` setting
Closes #12543
2016-04-19 17:14:23 +02:00
Lee Hinman a1e8fb794c Allow JSON with unquoted field names by enabling system property
In Elasticsearch 5.0.0, by default unquoted field names in JSON will be
rejected. This can cause issues, however, for documents that were
already indexed with unquoted field names. To alleviate this, a system
property has been added that can be enabled so migration can occur.

This system property will be removed in Elasticsearch 6.0.0

Resolves #17674
2016-04-19 09:14:13 -06:00
Nik Everett 4169b00441 Remove (read|write)PhraseSuggestionSmoothingModel 2016-04-19 10:25:50 -04:00
Nik Everett cd75c3da2e Remove (read|write)TaskStatus 2016-04-19 10:25:50 -04:00
Nik Everett 52f7c20344 Remove (read|write)SortBuilder 2016-04-19 10:25:50 -04:00
Nik Everett 38721ecf7b Remove writeAllocationCommand and writeValueFormat
Replace with writeNamedWriteable. s/write/read/g
2016-04-19 10:25:50 -04:00
Nik Everett c7c120c781 Remove PROTO from InnerHits
Relates to #17085
2016-04-19 10:17:49 -04:00
Nik Everett edf1c82007 Clean up serialization on some stats
Removes readFrom which is no longer required/actively discouraged and
replaces some instances of `Streamable` with `Writeable`.

Relates to #17085
2016-04-19 10:07:51 -04:00
Nik Everett 860559e543 Remove PROTOTYPE from ExtendedBounds
and make it implement Writeable because it is Writeable.

Relates to #17085
2016-04-19 09:58:37 -04:00
Nik Everett 65f6f6bc8d Normalize registration for SignificanceHeuristics
When I pulled on the thread that is "Remove PROTOTYPEs from
SignificanceHeuristics" I ended up removing SignificanceHeuristicStreams
and replacing it with readNamedWriteable. That seems like a lot at once
but it made sense at the time. And it is what we want in the end, I think.

Anyway, this also converts registration of SignificanceHeuristics to
use ParseFieldRegistry to make them consistent with Queries, Aggregations
and lots of other stuff.

Adds a new and wonderous hack to support serialization checking of
NamedWriteables registered by plugins!

Related to #17085
2016-04-19 09:47:37 -04:00
Nik Everett d62376ce33 Remove PROTOTYPE from KeyedFilter
Relates to #17085
2016-04-19 09:30:45 -04:00
Nik Everett c8af7edb24 Remove PROTOTYPE from AggregatorFactories
Relates to #17085
2016-04-19 09:29:06 -04:00
Daniel Mitterdorfer 0db3eaf7d7 Add additional assertions to IngestClientIT 2016-04-19 15:25:34 +02:00
Boaz Leskes 7cd128b372 Extract non-transport primary logic from TransportReplicationAction #16492
Extracts all the replication logic that is done on the Primary to a separated class called ReplicationOperation. The goal
here is to make unit testing of this logic easier and in the future allow setting up tests that work directly on IndexShards
without the need for networking.

Closes #16492
2016-04-19 15:45:59 +03:00
Nik Everett 7a2b923ad1 Remove deprecated registration methods
Removes deprecated registration methods from SearchModule and
NamedWriteableRegistry and removes the "shims" used to migrate
aggregations to the new registration methods.

Relates to #17085
2016-04-19 08:36:28 -04:00
Christoph Büscher bbe03c92c2 FiltersAggregatorBuilder: Don't create new context for inner parsing
We don't have to create new parse context for inner parsing.
2016-04-19 14:19:11 +02:00
Martijn van Groningen 1a55c073e8 added comment, why we fail here. 2016-04-19 11:32:00 +02:00
Martijn van Groningen 40c22fc654 percolator: removed .percolator type instead a field of type `percolator` should be configured before indexing percolator queries
* Added an extra `field` parameter to the `percolator` query to indicate what percolator field should be used. This must be an existing field in the mapping of type `percolator`.
* The `.percolator` type is now forbidden. (just like any type that starts with a `.`)

This only applies for new indices created on 5.0 and later. Indices created on previous versions the .percolator type is still allowed to exist.
The new `percolator` field type isn't active in such indices and the `PercolatorQueryCache` knows how to load queries from these legacy indices.
The `PercolatorQueryBuilder` will not enforce that the `field` parameter is of type `percolator`.
2016-04-19 11:20:31 +02:00
Jason Tedor ace83d9d2a Refactor UUID-generating methods out of Strings
This commit refactors the UUID-generating methods out of Strings into
their own class. The primary motive for this refactoring is to avoid a
chain of class initializers from loading this class earlier than
necessary. This was discovered when it was noticed that starting
Elasticsearch without any active network interfaces leads to some
logging statements being executed before logging had been
initailized. Thus:
 - these UUID methods have no place being on Strings
 - removing them reduces spooky action-at-distance loading of this class
 - removed the troublesome, logging statements from MacAddressProvider,
   logging using statically-initialized instances of ESLogger are prone
   to this problem

Relates #17837
2016-04-18 21:43:48 -04:00
Nik Everett 6941966b16 Remove PROTOs from TransportAddresses
We have this TransportAddressSerializers that works similarly to
NamedWriteables except it uses shorts instead of streams. I don't know
enough to propose removing it in favor of NamedWriteables to I just ported
it to using Writeable.Reader and left it alone.

Relates to #17085
2016-04-18 18:58:56 -04:00
Ryan Ernst 523b071836 Internal: Remove XContentBuilderString
This was previously used by xcontentbuilder to support camelCase.
However, it is no longer used, and can be replaced with just String.
2016-04-18 14:32:18 -07:00
Ryan Ernst 8ce71f8f25 Merge pull request #17774 from rjernst/camelcase1
Rest: Remove 'case' parameter from rest apis
2016-04-18 14:27:09 -07:00
Ryan Ernst 2739ee6c8f Merge branch 'master' into dots3 2016-04-18 14:24:37 -07:00
Ryan Ernst fbe1f50b18 Add check that no dynamic update was done with existing mappings and
dots
2016-04-18 14:24:11 -07:00
Nik Everett 23dc2d18a2 Fix javadoc for new methods 2016-04-18 16:21:50 -04:00
Nik Everett ff9b28d806 Deprecate remaining readXYZ|writeXYZ methods 2016-04-18 16:19:45 -04:00
Nik Everett 98fa71868c Replace (read|write)Rescorer with (read|write)NamedWriteable 2016-04-18 16:19:45 -04:00
Nik Everett d1722c9908 Replace (read|write)Shape with (read|write)NamedWriteable 2016-04-18 16:19:45 -04:00
Nik Everett d22603831d Replace (read|write)PipelineAggregatorBuilder with (read|write)NamedWriteable 2016-04-18 16:19:45 -04:00
Nik Everett 4ba8bce3fd Replace (read|write)AggregatorBuilder with (read|write)NamedWriteable 2016-04-18 16:19:44 -04:00
Nik Everett 70d55b36e1 Replace writeOptionalQuery with writeOptionalNamedWriteable 2016-04-18 16:19:44 -04:00
Nik Everett 8cffe0fc28 Remove readOptionalQuery
Replace it with readOptionalNamedWriteable
2016-04-18 16:19:44 -04:00
Nik Everett 68b4371bd9 Make readNamedWriteable and writeNamedWriteable public
Now anyone can read or write whatever, whenever.

Closes #17682
2016-04-18 16:19:44 -04:00
Nik Everett ed7b759a45 Cut max, min, stats, and extended stats aggregations over to registerAggregation
and remove their PROTOTYPEs.

Relates to #17085
2016-04-18 11:11:28 -04:00
Nik Everett f6d141a29c Cut percentiles and percentile_ranks to registerAggregation
and remove their PROTOTYPEs.

Relates to #17085
2016-04-18 11:05:39 -04:00
Nik Everett c5bad1d93f Cut remaining pipeline aggregations registerPipelineAggregation
Relates to #17085
2016-04-18 10:56:40 -04:00
Christoph Büscher 36622ecb59 Merge pull request #17822: Use try-with-resource when creating new parser instances where possible
We should wrap newly created XContent parser in a try-with-resources block so it gets properly closed after it has been used.
2016-04-18 16:38:56 +02:00
Christoph Büscher e06e122f9f Wrap xcontent parser creation in try-with-resource statement where possible 2016-04-18 16:13:56 +02:00
Nik Everett 08d3bf937d Cut moving_avg aggregation to registerPipelineAggregation
and remove its PROTOTYPE.

Relates to #17085
2016-04-18 09:37:07 -04:00
Nik Everett b8003de409 Cut bucket_script and bucket_selector to registerPipelineAggregation
and remove their PROTOTYPEs.

Relates to #17085
2016-04-18 09:26:04 -04:00
Christoph Büscher cdb36a2b0c Merge pull request #17417
Clean up QueryParseContext and don't hold it inside QueryRewrite/ShardContext
2016-04-18 15:13:53 +02:00
Nik Everett a9e85182f1 Cut serial_diff and cumulative_sum to registerPipelineAggregation
and remove their PROTOTYPEs.

Relates to #17085
2016-04-18 08:44:49 -04:00
Nik Everett e9fa53b87f Cut global, missing, cardinality, and value_count to registerAggregation
and remove their PROTOTYPEs.

Related to #17085
2016-04-18 08:32:24 -04:00
Christoph Büscher e7cbc55592 Cleaning up query shard context creation in AbstractQueryTestCase 2016-04-18 14:27:50 +02:00
Nik Everett 070b78517e Cut stats_bucket and extended_stats_bucket to registerPipelineAggregation
and remove their PROTOTYPE.

Relates to #17085
2016-04-18 08:19:08 -04:00
Jim Ferenczi 6e4273ae0b Merge pull request #17818 from jimferenczi/search_slow_log
Add missing index name to search slow log.
2016-04-18 12:40:53 +02:00
Danilo Vaz 2e2d8c1442 Updated copyright years to include 2016 (#17808) 2016-04-18 12:39:23 +02:00
Christoph Büscher 478b5024f2 Wrap parser creation in try-with-resources 2016-04-18 12:30:57 +02:00
Jim Ferenczi 3dc21e780b Add missing index name to search slow log.
This commits adds the index name as part of the logging message.
Closes #17025
2016-04-18 12:13:10 +02:00
Daniel Mitterdorfer b84a192884 Honor invariant Suggest.suggestions != null 2016-04-18 10:18:23 +02:00
Daniel Mitterdorfer b9faa13274 Balance request sizes in NettyHttpRequestSizeLimitIT
This test should demonstrate that a single (larger)
request is processed but on of multiple large concurrent requests
is rejected. This test broke too early under some circumstances in
network mode as the limit is quite low.

With this commit we reduce the size of the individual large
requests but issue more concurrent ones thus increasing stability
of this test.
2016-04-18 09:31:48 +02:00
Jim Ferenczi 4575d79522 Merge pull request #17776 from jimferenczi/simple_query_string_wildcard
Apply the default operator on analyzed wildcard in simple_query_string builder
2016-04-15 22:22:55 +02:00
Jim Ferenczi b4e6b63088 Apply the default operator on analyzed wildcard in simple_query_string builder:
* This is a followup from https://github.com/elastic/elasticsearch/pull/17711 where we now apply the default operator on analyzed wildcard query in query_string builder.
2016-04-15 21:56:50 +02:00
Jim Ferenczi 781c0abdc0 Add MatchNoDocsQuery, a query that matches no documents and prints the reason why in the toString method. 2016-04-15 21:53:29 +02:00
David Pilato 5e1f26c22a Add support for documented byte/size units and for micros as a time unit in _cat API
We advertise in our documentation that byte units are like `kb`, `mb`... But we actually only support the simple notation `k` or `m`.
This commit adds support for the documented form and keeps the non documented options to avoid any breaking change.

It also adds support for `micros`, `nanos` and `d` as a time unit in `_cat` API.

Remove the support for `b` as a SizeValue unit. Actually, for numbers, when using raw numbers without unit, there is no text to add/parse after the number. For example, you don't write `10` as `10b`. We support option like `size=` in `_cat` API which means that we want to display raw data without unit (singles).

Documentation updated accordingly.

Add test for the empty size option.

Fix missing TimeValues options for some cat APIs
2016-04-15 20:55:41 +02:00
Christoph Büscher f7e79f4981 Pass down parse context instead of just parser in completion context suggester. 2016-04-15 20:51:05 +02:00
Nik Everett 65803f8abd Cut significant_terms to registerAggregation
and remove its PROTOTYPE.

Relates to #17085
2016-04-15 14:23:43 -04:00
Nik Everett d223090d7d Cut top_hits aggregation to registerAggregation
and remove its PROTOTYPE.

Relates to #17085
2016-04-15 14:15:12 -04:00
Nik Everett c94302d246 Cut geo aggregations to registerAggregation
and remove their prototypes.

Relates to #17085
2016-04-15 14:01:48 -04:00
Michael McCandless b55368b39d Merge pull request #17778 from mikemccand/imc_registered_settings
Switch to registered Settings for all IndexingMemoryController settings
2016-04-15 13:14:12 -04:00
Christoph Büscher 4e77adf38e Clean up creation of shard context in AbstractQueryTestCase
The queryShardContext we create during setup was sometimes
accessed directly, sometimes by making a copy through
the createShardContext() helper. This should be the default.
Also making sure that strict parsing is switched on via
IndexSettings in the test testup.
2016-04-15 17:47:19 +02:00
Christoph Büscher fbd558382d Clean up QueryParseContext and don't hold it inside QueryRewrite/ShardContext
This change cleans up a few things in QueryParseContext and QueryShardContext
that make it hard to reason about the state of these context objects and are
thus error prone and should be simplified.

Currently the parser that used in QueryParseContext can be set and reset any
time from the outside, which makes reasoning about it hard. This change makes
the parser a mandatory constructor argument removes ability to later set a
different ParseFieldMatcher. If none is provided at construction time, the
one set inside the parser is used. If a ParseFieldMatcher is specified at
construction time, it is implicitely set on the parser that is beeing used.
The ParseFieldMatcher is only kept inside the parser.

Also currently the QueryShardContext historically holds an inner QueryParseContext
(in the super class QueryRewriteContext), that is mainly used to hold the parser
and parseFieldMatcher. For that reason, the parser can also be reset, which leads
to the same problems as above. This change removes the QueryParseContext from
QueryRewriteContext and removes the ability to reset or retrieve it from the
QueryShardContext. Instead, `QueryRewriteContext#newParseContext(parser)` can be
used to create new parse contexts with the given parser from a shard context
when needed.
2016-04-15 17:13:01 +02:00
Nik Everett b5a58ece41 Cut nested and reverse_nested aggregations to registerAggregation
and remove their PROTOTYPES.

Relates to #17085
2016-04-15 10:19:03 -04:00
Adrien Grand eb4ba38032 Add points to SegmentStats. #17775
This way points memory and disk usage will be reported in the stats API.

Closes #16974
2016-04-15 15:58:26 +02:00
Nik Everett 7f6a765a1e Cut the sampler and diversified_sampler aggregations to registerAggregation
and remove their PROTOTYPEs.

Relates to #17085
2016-04-15 09:53:56 -04:00
Mike McCandless a361f5b810 fix test method name 2016-04-15 09:47:08 -04:00
Mike McCandless 529087301a fix IndexingMemoryController to use existing Settings API support to parse % or byte size, and to enforce min/max values; don't try to share string constants for settings in tests 2016-04-15 09:42:29 -04:00
Christoph Büscher 068df5f8aa Merge pull request #17756 from cbuescher/no-pfm-in-parser
Remove ParseFieldMatcher from AbstractXContentParser
2016-04-15 15:21:27 +02:00
Christoph Büscher de036d63d8 Rename context.parseFieldMatcher() to context.getParseFieldMatcher 2016-04-15 15:15:32 +02:00
Christoph Büscher 15c59d07b3 Remove ParseFieldMatcher from AbstractXContentParser
Currently we are able to set a ParseFieldMatcher on XContentParsers,
mainly to conveniently carry it around to be available where the
actual parsing happens. This was just recently introduced together
with ObjectParser so that ObjectParser can make use of deprecation
logging and throwing errors while parsing.

This however is trappy because we create parsers in so many places in
the code and it is easy to forget setting the right ParseFieldMatcher.
Instead we should hold the ParseFieldMatcher only in the parse contexts
(e.g. QueryParseContext).

This PR removes the ParseFieldMatcher from XContentParser. ObjectParser
can still make use of it because we can make the otherwise unbounded
`context` type to extend an interface that makes sure contexts used in
ObjectParser can supply a ParseFieldMatcher. Contexts in ObjectParser
are now no longer optional, but it is sufficient to pass in a small
lambda expression in places where no other context is available.

Relates to #17417
2016-04-15 15:14:46 +02:00
Nik Everett e3c65408ec Cut terms aggregation to registerAggregation
and remove its PROTOTYPE. This is the first aggregation builder that
serializes its targetValueType so ValuesSourceAggregatorBuilder had to
grow support for that.

Relates to #17085
2016-04-15 09:12:29 -04:00
Nik Everett cf80b00507 Cut filters aggregation to registerAggregation
and remove its PROTOTYPE.
2016-04-15 09:04:46 -04:00
Nik Everett 135511134c Fix bad toXContent for derivative aggregation
I busted it in the last commit.
2016-04-15 08:51:22 -04:00
Nik Everett a36b6138d7 Cut avg aggregation to registerAggregation
and remove its PROTOTYPE

Relates to #17085
2016-04-15 08:37:22 -04:00
Nik Everett b10c1f1939 Cut derivative aggregation to registerPipelineAggregation
and remove its PROTOTYPE.
2016-04-15 08:28:18 -04:00
Nik Everett beafae8ea5 Cut range aggregations to registerAggregation
and remove their PROTOTYPES. Does not remove the PROTOTYPEs from their
Range implementations which will have to wait for another commit.
2016-04-15 08:14:05 -04:00
Mike McCandless 36e99c5f8d switch to registered Settings for all IndexingMemoryController settings 2016-04-15 06:10:30 -04:00
Colin Goodheart-Smithe d863cbaa07 [TEST] fix geo_bounding_box tests to work with unmapped fields 2016-04-15 10:10:43 +01:00
Daniel Mitterdorfer 3688629e11 Adjust line-length of transport related classes to coding standard 2016-04-15 10:12:24 +02:00
Ryan Ernst c3f4eb36e3 Merge pull request #17768 from rjernst/dots4
Mappings: Fix array parsing to remove its context when finished parsing
2016-04-15 00:22:55 -07:00
Ryan Ernst 88dd6ba430 Rest: Remove 'case' parameter from rest apis
The current api allows for choosing which "case" response json keys are
written in. This has the options of camelCase or underscore. camelCase
is going to be deprecated from the query apis. However, with the case
api, it is not necessary to deprecate, as users who were using it in 2.x
can transition completely on 2.x before upgrading by simply using
the underscore option.

This change removes the 'case' option from rest apis.

see #8988
2016-04-14 23:07:19 -07:00
Jason Tedor f985cfc95a Add max map count check
This commit adds a bootstrap check on Linux for the max map count (max
virtual memory areas) available to the Elasticsearch process.

Relates #16944
2016-04-14 21:04:03 -04:00
Igor Motov f030796b0b Shard level tasks in Bulk Action lose reference to their parent tasks
During the bulk action a hierachy of tasks is getting created: bulk->bulk[s] (coord node) -> bulk[s] (primary shard node) -> bulk[s][p] and bulk[s][r]. Due to a bug the first bulk[s] task didn't have bulk's task id is set as a parent id.  This commit fixes this bug.
2016-04-14 19:30:07 -04:00
Ryan Ernst 24130e1f30 Merge pull request #17764 from rjernst/parse_doc_without_threadlocal
Internal: Remove threadlocal from document parser
2016-04-14 15:17:45 -07:00
Ryan Ernst 60df3450f4 Mappings: Fix array parsing to remove its context when finished parsing
Handling of the current path when parsing a document is very sensitive.
This fixes a subtle bug in array parsing, where the path that was added
by parsing an array would not be cleared. It also adds a hard state
check at the end of parsing to ensure we ended with a clean path.
2016-04-14 14:45:29 -07:00
Ryan Ernst c6dd17a2c6 Internal: Remove threadlocal from document parser
The doc parser uses a context object to store the state of parsing,
namely the existing mappings, new mappings, and the parsed document.
Currently this uses a threadlocal which is "reset" for each doc parsed.
However, the thread local doesn't actually save anything, since
resetting is constructing new objects. This change removes the thread
local, which also simplifies the mapper service as it now does not need
to be closeable.
2016-04-14 13:10:20 -07:00
Ryan Ernst 125473dc9f Mappings: Support dots in field names when mapping exists
In 2.0 we began restricting fields to not contains dots in their names.
This change adds back part of dots in fieldnames support. Specifically,
it allows indexing documents that contain dots in the field names, when
the correct corresponding mappers exist. For example, if mappings
contain an object field `foo`, and a subfield `bar`, then indexing a
document with `foo.bar` will work.

see #15951
2016-04-14 11:31:45 -07:00
Jason Tedor ea26e86880 Actually restore lost Node#start no-op check
This commit really reverts the inadvertent removal of allowing duplicate
calls to Node#start to be a no-op (but was mistakenly restored to
Node#stop in ddfa3a661510f25c2ce431dfd6fb86ac11eb8888).
2016-04-14 14:26:04 -04:00
Jason Tedor f87c599ff1 Revert "Restore lost Node#start no-op check"
This reverts commit ddfa3a661510f25c2ce431dfd6fb86ac11eb8888.
2016-04-14 14:26:04 -04:00
Nik Everett 3197f7f7d8 Remove PROTOTYPE from filter aggregation
and cut it to registerAggregation

Relates to #17085
2016-04-14 12:37:40 -04:00
Adrien Grand 0c9aca94d4 Disallow fielddata loading on text fields that are not indexed. #17747
If a field is not indexed, we cannot load fielddata for it.
2016-04-14 18:11:11 +02:00
Colin Goodheart-Smithe 90d044309f Merge pull request #17710 from colings86/deprecate/indicesQuery
Deprecate Indices query
2016-04-14 17:09:42 +01:00
Adrien Grand d84c643f58 Use the new points API to index numeric fields. #17746
This makes all numeric fields including `date`, `ip` and `token_count` use
points instead of the inverted index as a lookup structure. This is expected
to perform worse for exact queries, but faster for range queries. It also
requires less storage.

Notes about how the change works:
 - Numeric mappers have been split into a legacy version that is essentially
   the current mapper, and a new version that uses points, eg.
   LegacyDateFieldMapper and DateFieldMapper.
 - Since new and old fields have the same names, the decision about which one
   to use is made based on the index creation version.
 - If you try to force using a legacy field on a new index or a field that uses
   points on an old index, you will get an exception.
 - IP addresses now support IPv6 via Lucene's InetAddressPoint and store them
   in SORTED_SET doc values using the same encoding (fixed length of 16 bytes
   and sortable).
 - The internal MappedFieldType that is stored by the new mappers does not have
   any of the points-related properties set. Instead, it keeps setting the index
   options when parsing the `index` property of mappings and does
   `if (fieldType.indexOptions() != IndexOptions.NONE) { // add point field }`
   when parsing documents.

Known issues that won't fix:
 - You can't use numeric fields in significant terms aggregations anymore since
   this requires document frequencies, which points do not record.
 - Term queries on numeric fields will now return constant scores instead of
   giving better scores to the rare values.

Known issues that we could work around (in follow-up PRs, this one is too large
already):
 - Range queries on `ip` addresses only work if both the lower and upper bounds
   are inclusive (exclusive bounds are not exposed in Lucene). We could either
   decide to implement it, or drop range support entirely and tell users to
   query subnets using the CIDR notation instead.
 - Since IP addresses now use a different representation for doc values,
   aggregations will fail when running a terms aggregation on an ip field on a
   list of indices that contains both pre-5.0 and 5.0 indices.
 - The ip range aggregation does not work on the new ip field. We need to either
   implement range aggs for SORTED_SET doc values or drop support for ip ranges
   and tell users to use filters instead. #17700

Closes #16751
Closes #17007
Closes #11513
2016-04-14 17:56:23 +02:00
Nik Everett 9080f51340 NORELEASE for getWriteableName in aggregations base class 2016-04-14 11:33:03 -04:00
Nik Everett f095e64825 Remove PROTOTYPE from histogram aggregations 2016-04-14 11:22:52 -04:00
Ali Beyad b87fd54ba9 Improvements to the IndicesService class
This commit contains the following improvements/fixes:
  1. Renaming method names and variables to better reflect the purpose
of the method and the semantics of the variable.
  2. For deleting indexes, replace the closed parameter passed to the
delete index/store methods with obtaining the index's state from the
IndexSettings that is already passed in.
  3. Added tests to the IndexWithShadowReplicaIT suite, some of which
show issues in the shadow replica delete process that are captured in
Github issue 17695.

Closes #17638
2016-04-14 11:14:02 -04:00
Christoph Büscher c9cb1de6cb Remove parser argument from methods where we already pass in a parse context
When we pass both XContentParser and QueryParseContext to a method this can be trappy because 
we cannot make sure that the parser contained in the context and the parser passed as an argument 
are the same. 
This removes the parser argument from methods where we currently have both the parser and the parse 
context as arguments and instead retrieves the parse from the context inside the method.
2016-04-14 17:09:52 +02:00
Nik Everett 348ad7a42e Label method as @SafeVarargs 2016-04-14 10:45:58 -04:00
Nik Everett eecec97274 Fix funny generics in request size limit test 2016-04-14 10:45:58 -04:00
Nik Everett eb71918878 Add SearchAfter's validation back to the setter
It was part of the serialization but I removed it to convert to
writeGenericValue.
2016-04-14 10:31:35 -04:00
Nik Everett f1ad5254e4 Switch SearchAfterBuilder to writeGenericValue
and remove its PROTOTYPE.

Relates to #17085
2016-04-14 10:31:27 -04:00
Nik Everett 8ad0070cea Remove remaining PROTOTYPEs from org.elasticsearch.search.suggest 2016-04-14 10:30:31 -04:00
Colin Goodheart-Smithe c595322d90 Adds ignore_unmapped option to geo queries
The change adds a new option to the geo_* queries: ignore_unmapped. If this option is set to false, the toQuery method on the QueryBuilder will throw an exception if the field specified in the query is unmapped. If the option is set to true, the toQuery method on the QueryBuilder will return a MatchNoDocsQuery. The default value is false so the queries work how they do today (throwing an exception on unmapped field)
2016-04-14 15:29:07 +01:00
Christoph Büscher bccf8a39c4 Removing aggregations_binary support from AggregatorParsers 2016-04-14 16:22:27 +02:00
Nik Everett 18f8f3f67a Cleanup after removing StreamableReader
Javadoc and unused imports!
2016-04-14 10:22:23 -04:00
Nik Everett b8fa7abf6a Remove StreamableReader
It's use tempted the creation of PROTOTYPEs. The only classes that
legitimately implement a readFrom method are those extending from
Diffable - such behavior is part of cluster state management and
out of scope for the PROTOTYPE cleanup.
2016-04-14 10:22:23 -04:00
Christoph Büscher e15e7f7e6e Remove parser argument from methods where we already pass in a parse context
When we pass down both parser and QueryParseContext to a method, we cannot
make sure that the parser contained in the context and the parser that is
parsed as an argument have the same state. This removes the parser argument
from methods where we currently have both the parser and the parse context
as arguments and instead retrieves the parse from the context inside the
method.
2016-04-14 16:18:05 +02:00
Jason Tedor ed3a71fa2b Fix JvmInfoTests#testUseG1GC to include OpenJDK VMs
Since OpenJDK virtual machines have G1 GC but do not have a java.vm.name
that contains HotSpot, this test fails on OpenJDK. Instead, the
java.vm.name condition should be expanded to include OpenJDK virtual
machines.
2016-04-14 10:09:55 -04:00
Nik Everett 1c5449fe1a Remove PROTOTYPE from scripted_metric aggregation
and cut it to registerAggregation.

Relates to #17085
2016-04-14 10:05:26 -04:00
Yannick Welsch b7a1baa801 Simplify ActionListenerResponseHandler by adding response supplier (#17752) 2016-04-14 15:46:55 +02:00
Adrien Grand b3eef99120 Remove FieldStats.Float. #17749
Since doubles can represent all floats accurately, we can just use
FieldStats.Double instead.
2016-04-14 15:03:35 +02:00
Martijn van Groningen 2928fd6ef3 Cleanup query builder for inner hits construction.
* Inner hits can now only be provided and prepared via setter in the nested, has_child and has_parent query.
* Also made `score_mode` a required constructor parameter.
* Moved has_child's min_child/max_children validation from doToQuery(...) to a setter.
2016-04-14 14:43:21 +02:00
Jason Tedor c9ada75e35 Merge pull request #17740 from jasontedor/g1gc-tests
Pass test JVM arguments to test nodes
2016-04-14 08:08:11 -04:00
Jason Tedor 79d3415210 Help JDK 9 type inference in ShardStateIT.java
The JDK 9 compiler type inference gets confused, so we need to help it
here.
2016-04-14 07:43:41 -04:00
Jason Tedor 4b801f54d1 Add test that JvmInfo correctly determines G1 GC
This commit adds a simple test that JvmInfo is correctly able to
determine whether or not G1 GC is running. As the JvmInfo G1 GC logic is
only applies to HotSpot, the test is constructed to do the same. The
test determines whether or not G1 GC is running by inspecting the test
JVM argument line.
2016-04-14 07:43:40 -04:00
Nik Everett dd3b4a1e50 Add {} to ifs in org.apache.lucene 2016-04-14 07:38:08 -04:00
Daniel Mitterdorfer e87b09e8dd Temporarily disable CircuitBreakerServiceIT.testParentChecking() 2016-04-14 13:07:11 +02:00
Colin Goodheart-Smithe 686aff1545 Adds ignore_unmapped option to nested and P/C queries
The change adds a new option to the `nested`, `has_parent`, `has_children` and `parent_id` queries: `ignore_unmapped`. If this option is set to false, the `toQuery` method on the QueryBuilder will throw an exception if the type/path specified in the query is unmapped. If the option is set to true, the `toQuery` method on the QueryBuilder will return a MatchNoDocsQuery. The default value is `false`so the queries work how they do today (throwing an exception on unmapped paths/types)
2016-04-14 10:34:30 +01:00
Daniel Mitterdorfer c22d93f7cc Increase breaker limit in NettyHttpRequestSizeLimitIT
With the previous breaker limit spurious failures on transport level
can happen in the test. With the new limit we ensure that the breaker
breaks due to a too large HTTP request instead.
2016-04-14 10:12:45 +02:00
Adrien Grand 1c858b57c4 Fix test bug in ZenDiscoveryIT. 2016-04-14 09:52:25 +02:00
Colin Goodheart-Smithe f7ef600644 Aggregations: Adds serialisation of sigma to extended_stats_bucket pipeline aggregation
Previously the sigma variable in the `extended_stats_bucket` pipeline aggregation was not being serialised in `ExtendedStatsBucketPipelineAggregator`. This PR fixes that.

It also corrects the initial value of sumOfSquares to be 0.

Closes #17701
2016-04-14 08:28:56 +01:00
Nik Everett 86a9365c53 Small format changes in script and monitor packages
Just three files - just adding {}s to if and for statements or making
them single line.
2016-04-13 22:02:42 -04:00
Nik Everett 0386d8ec84 Remove PROTOTYPE from ScriptField
Relates to #17085
2016-04-13 21:30:01 -04:00
Jason Tedor 666172284b Refactor BootstrapCheckTests to use expectThrows
This commit modifies all uses of the pattern try/catch/assert in
BootstrapCheckTests to use expectThrows/assert.

Closes #17731
2016-04-13 18:41:14 -04:00
Nik Everett 3d5def0789 Remove remaining PROTOTYPEs from org.elasticsearch.index.query
Relates to #17085
2016-04-13 16:16:28 -04:00
Jason Tedor 11648cbff6 Merge pull request #17728 from jasontedor/heap-size
Add heap size bootstrap check
2016-04-13 15:11:17 -04:00
Jason Tedor 4f5d73bcb7 Add heap size bootstrap check
This commit adds a bootstrap check to ensure that the initial heap size
and max heap size are set equal to each other.
2016-04-13 15:10:31 -04:00
Boaz Leskes a0d1f8889d Rebalancing policy shouldn't prevent hard allocation decisions (#17698)
#14259 added a check to honor rebalancing policies (i.e., rebalance only on green state) when moving shards due to changes in allocation filtering rules. The rebalancing policy is there to make sure that we don't try to even out the number of shards per node when we are still missing shards. However, it should not interfere with explicit user commands (allocation filtering) or things like the disk threshold wanting to move shards because of a node hitting the high water mark.

#14259 was done to address #14057 where people reported that using allocation filtering caused many shards to be moved at once. This is however a none issue - with 1.7 (where the issue was reported) and 2.x, we protect recovery source nodes by limitting the number of concurrent data streams they can open (i.e., we can have many recoveries, but they will be throttled). In 5.0 we came up with a simpler and more understandable approach where we have a hard limit on the number of outgoing recoveries per node (on top of the incoming recoveries we already had).
2016-04-13 20:44:41 +02:00
Igor Motov b01f3b2cd1 Node names cleanup
Fixes two node names contained trailing spaces that was causing cat.tasks test to fail.

Fixes #17718
2016-04-13 12:50:12 -04:00
Sebastian Utz 0b889f1a8f Fix index selection for snapshot restore when non-existent indices are specified (#17715) 2016-04-13 17:25:59 +02:00
Jason Tedor 96456fbd91 Remove remaining uses of JAVA_OPTS
This commit removes the last remaining uses of JAVA_OPTS. Now searching
the codebase for the regex '(?<!ES_)JAVA_OPTS' only shows the uses
warning of its removal and the note about it in the migration docs.
2016-04-13 10:51:53 -04:00
Jim Ferenczi 3c355b66fe Apply the default operator on analyzed wildcard in query_string builder:
* Tokens in the same position are grouped into a SynonymQuery..
 * The default operator is applied on tokens in different positions.
 * The wildcard is applied to the terms in the last position only.
Fixes #2183
2016-04-13 15:41:29 +02:00
Nik Everett edc09a7ac5 Add NORELEASE while we migrate aggregations 2016-04-13 09:31:54 -04:00