Commit Graph

21340 Commits

Author SHA1 Message Date
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
LeonardGC 0b8be7f894 Update field-mapping.asciidoc (#17670) 2016-04-15 09:22:38 +02: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 6d8ab56350 Merge pull request #17769 from rjernst/gradle_idea_excludes
Build: Exclude gradle and eclipse build dirs from intellij
2016-04-14 15:16:05 -07:00
Ryan Ernst ba2abbf37c Build: Exclude gradle and eclipse build dirs from intellij
Intellij has a model of "everything is a source dir unless you say
otherwise". This change fixes the intellij configuration to not think
the gradle or eclipse build dirs are source dirs.
2016-04-14 14:54:52 -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
bloublou 83944c5628 Typo correction heap_size.asciidoc (#17745)
* Typo correction Xms Xmx

Typo correction on "-Xms4000mb -Xmx4000mb"

* Change mb to m for Xms/Xmx
2016-04-14 20:37:37 +02: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
jaymode f35cfc3715 Copy checkstyle config to allow running from a jar
The checkstyle configuration files were being accessed as resources within the project and
being converted from a URL to a File by gradle. This works when the build tools project is being
referenced as a local project. However, when using the published jar the URL points to a resource
in the jar file, that URL cannot be converted to a File object and causes the build to fail.

This change copies the files into a `checkstyle` directory in the project build folder and always uses
File objects pointing to the copied files.
2016-04-14 13:33:10 -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
Clinton Gormley acec464eb8 Docs: Clarified the purpose of the parent_id query 2016-04-14 11:25:26 +02: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