Commit Graph

5069 Commits

Author SHA1 Message Date
Adrien Grand b6556e275a Remove code duplication in FieldsVisitor. #18218
It currently has twice the same method, once with a MapperService instance and
once with a DocumentMapper. This commits only keeps the former.
2016-05-10 08:17:59 +02:00
Adrien Grand f481492af3 Remove FieldMapper.Builder.indexName. #18219
The ability to configure index names that are different from the full name was
removed in 2.0.
2016-05-10 08:17:00 +02:00
Adrien Grand 68e7ac4166 Remove old backward compatibility layer for version lookups. #18215
The current code tries to handle the case that document versions are either
missing or stored in payloads rather than doc values. Since none of the 2.x
releases allowed this, we can remove this logic.
2016-05-10 08:16:05 +02:00
Adrien Grand 5d8f684319 Mapping cleanups. #18180
This removes dead/duplicate code and makes the `_index` field not configurable.
(Configuration used to jus be ignored, now we would throw an exception if any
is provided.)
2016-05-10 08:14:18 +02:00
Jason Tedor eed5b0be4f Increaes timeout on Netty handshake tests
This commit increases the timeout on the Netty handshake tests because
the previous value could cause timeout exceptions on slow machines.
2016-05-09 19:02:54 -04:00
Johnny Lim 0970c59608 Use Strings.toString() for toString() in SearchResponse and GetResponse (#18102) 2016-05-09 16:56:02 -04:00
Jim Ferenczi aef78ceb13 Do not return fieldstats information for fields that exist in the mapping
but not in the index.
2016-05-09 19:24:03 +02:00
Daniel Mitterdorfer 0f36c744d0 Merge remote-tracking branch 'danielmitterdorfer/eager-content-length' 2016-05-09 15:10:01 +02:00
Daniel Mitterdorfer 3a46812a33 Free bytes reserved on request breaker
With this commit we free all bytes reserved on the request
circuit breaker.

Closes #18144
2016-05-09 15:07:41 +02:00
Daniel Mitterdorfer 000dd62318 Determine content length eagerly in HttpServer
With this commit we eagerly evaluate content length in HttpServer
and also pass the same value to ResourceHandlingHttpChannel. With
this change it easier to reason about the content length that is
freed leaving no doubt that it must be identical to the reserved
amount.
2016-05-09 11:11:59 +02:00
Ryan Ernst c740feb3a7 Mappings: Fix ip mapper to correctly serialize a null null_value
We recently added correct serialization for null values, but the helper
method used does not allow null. This fixes serialization to handle the
null.
2016-05-06 17:07:24 -07:00
Tal Levy c1afcb543e add check for non-existent pipelines provided to simulate requests (#18190)
fixes #18139
2016-05-06 13:34:22 -07:00
Jason Tedor d0d2d2be8c Fix exception message in lifecycle
This commit fixes the exception messages for lifecycles when stopping in
illegal states.

Relates #18189
2016-05-06 16:14:43 -04:00
Ryan Ernst 2c3d3d91cb Remove unnecessary nebula source or javadoc plugins 2016-05-06 13:09:48 -07:00
Ryan Ernst 3d1be071c9 Merge branch 'master' into pom_gen 2016-05-06 12:56:51 -07:00
Chris Earle 5be79ed02c Add Failure Details to every NodesResponse
Most of the current implementations of BaseNodesResponse (plural Nodes) ignore FailedNodeExceptions.

- This adds a helper function to do the grouping to TransportNodesAction
- Requires a non-null array of FailedNodeExceptions within the BaseNodesResponse constructor
- Reads/writes the array to output
- Also adds StreamInput and StreamOutput methods for generically reading and writing arrays
2016-05-06 14:59:43 -04:00
Chris Earle 1d5b9f1ce6 Test was not updated with #18187 2016-05-06 13:17:43 -04:00
Tanguy Leroux 0ff5652fff Add node name to Cat Recovery
closes #8041
2016-05-06 16:59:53 +02:00
Britta Weber 901c25b7ff Merge pull request #18183 from brwe/exclude-all-but-text-from-wildcard-highlighting
Exclude all but string fields from highlighting if wildcards are used…
2016-05-06 16:57:25 +02:00
Britta Weber f270ed26c3 fix highlighing for old version indices with string fields 2016-05-06 16:27:31 +02:00
Jason Tedor d52537dc7b Add semicolon query string parameter delimiter
This commit adds support for the semicolon character as a valid query
string parameter delimiter.

Relates #18186
2016-05-06 09:54:26 -04:00
Jason Tedor e90d00ffce Remove handshake from transport client
This commit removes handshaking from the transport client. This
handshaking is not needed because of the existence of the liveness
check.

Relates #18174
2016-05-06 09:17:18 -04:00
Nik Everett b6698c3145 Random script fields can't overlap
This causes round tripping through xcontent to fail.

Closes #18166
2016-05-06 09:01:09 -04:00
Alexander Reelsen b12a42351e Pipeline Stats: Fix concurrent modification exception (#18177)
Due to trying to modify a map while iterating it, a concurrent modification
in the pipeline stats could be thrown. This uses an iterator to prevent this.

Closes #18126
2016-05-06 15:00:41 +02:00
Britta Weber 7b69e4ef43 keyword fields should also be highlighted 2016-05-06 14:29:19 +02:00
Britta Weber d3c5f865be Exclude all but string fields from highlighting if wildcards are used in fieldname
We should prevent highlighting if a field is anything but a text or keyword field.
However, someone might implement a custom field type that has text and still want to
highlight on that. We cannot know in advance if the highlighter will be able to
highlight such a field and so we do the following:
If the field is only highlighted because the field matches a wildcard we assume
it was a mistake and do not process it.
If the field was explicitly given we assume that whoever issued the query knew
what they were doing and try to highlight anyway.

closes #17537
2016-05-06 13:41:16 +02:00
Adrien Grand 93567a2f1b Remove StringBuilder reuse for uid creation. #18181
This would be better handled by escape analysis.
2016-05-06 13:16:58 +02:00
Adrien Grand e88ac11633 Add back Version.V_5_0_0. #18176
This was lost whene releasing alpha2 since the version constant got renamed.
2016-05-06 12:30:22 +02:00
Christoph Büscher 7d14728960 Add xContent shuffling to some more tests
This adds some random shuffling of xContent to some more test cases.

Relates to #5831
2016-05-06 10:46:39 +02:00
Adrien Grand b91df36a62 Fix and test handling of `null_value`. #18090
This was mostly untested and had some bugs.

Closes #18085
2016-05-06 09:28:23 +02:00
Adrien Grand de8354dd7f Allow binary sort values. #17959
The `ip` field uses a binary representation internally. This breaks when
rendering sort values in search responses since elasticsearch tries to write a
binary byte[] as an utf8 json string. This commit extends the `DocValueFormat`
API in order to give fields a chance to choose how to render values.

Closes #6077
2016-05-06 09:27:02 +02:00
Adrien Grand 7d8708716e QueryBuilder does not need generics. #18133
QueryBuilder has generics, but those are never used: all call sites use
`QueryBuilder<?>`. Only `AbstractQueryBuilder` needs generics so that the base
class can contain a default implementation for setters that returns `this`.
2016-05-06 08:38:20 +02:00
Ryan Ernst e16af604bf Build: Add pom generation to assemble task
In preparation for a unified release process, we need to be able to
generate the pom files independently of trying to actually publish. This
change adds back the maven-publish plugin just for that purpose. The
nexus plugin still exists for now, so that we do not break snapshots,
but that can be removed at a later time once snapshots are happenign
through the unified tools. Note I also changed the dir jars are written
into so that all our artifacts are under build/distributions.
2016-05-05 17:57:44 -07:00
Jason Tedor 1199cd8e2a Mark IHBT#testFromAndToXContent as awaits fix
This commit marks InnerHitsBuilderTests#testFromAndToXContent as
awaiting a fix.
2016-05-05 20:16:57 -04:00
Robert Muir e3ce6c9048 Painless: add fielddata accessors (.value/.values/.distance()/etc)
This gives better coverage and consistency with the scripting APIs, by
whitelisting the primary search scripting API classes and using them instead
of only Map and List methods.

For example, accessing fields can now be done with `.value` instead of `.0`
because `getValue()` is whitelisted. For now, access to a document's fields in
this way (loads) are fast-pathed in the code, to avoid dynamic overhead.

Access to geo fields and geo distance functions is now supported.

TODO: date support (e.g. whitelist ReadableDateTime methods as a start)
TODO: improve docs (like expressions and groovy have for document's fields)
TODO: remove fast-path hack

Closes #18169

Squashed commit of the following:

commit ec9f24b2424891a7429bb4c0a03f9868cba0a213
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 17:59:37 2016 -0400

    cutover to <Def> instead of <Object> here

commit 9edb1550438acd209733bc36f0d2e0aecf190ecb
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 17:03:02 2016 -0400

    add fast-path for docvalues field loads

commit f8e38c0932fccc0cfa217516130ad61522e59fe5
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 16:47:31 2016 -0400

    Painless: add fielddata accessors (.value/.values/.distance()/etc)
2016-05-05 18:38:41 -04:00
Ali Beyad c4090a1841 Remove the Snapshot class in favor of using SnapshotInfo
o/e/snapshots/Snapshot and o/e/snapshots/SnapshotInfo contain the same
fields and represent the same information.  Snapshot was used to
maintain snapshot information to the snapshot repository, while
SnapshotInfo was used to represent the snapshot information as presented
through the REST layer.  This removes the Snapshot class and combines
all uses into the SnapshotInfo class.

Closes #18167
2016-05-05 16:53:13 -04:00
Nik Everett 4b1c116461 Generate and run tests from the docs
Adds infrastructure so `gradle :docs:check` will extract tests from
snippets in the documentation and execute the tests. This is included
in `gradle check` so it should happen on CI and during a normal build.

By default each `// AUTOSENSE` snippet creates a unique REST test. These
tests are executed in a random order and the cluster is wiped between
each one. If multiple snippets chain together into a test you can annotate
all snippets after the first with `// TEST[continued]` to have the
generated tests for both snippets joined.

Snippets marked as `// TESTRESPONSE` are checked against the response
of the last action.

See docs/README.asciidoc for lots more.

Closes #12583. That issue is about catching bugs in the docs during build.
This catches *some* bugs in the docs during build which is a good start.
2016-05-05 13:58:03 -04:00
Jason Tedor e11b96ca9c Default to server VM and add client VM check
Today we softly warn about running with the client VM. However, we
should really refuse to start in production mode if running with the
client VM as the performance of the client VM is too devastating for a
server application. This commit adds an option to jvm.options to ensure
that we are starting with the server VM (on all 32-bit non-Windows
platforms on server-class machines (2+ CPUs, 2+ GB physical RAM) this is
the default and on all 64-bit platforms this is the only option) and
adds a bootstrap check for the client VM.

Relates #18155
2016-05-05 10:36:21 -04:00
Jason Tedor 784c9e5fb9 Introduce node handshake
This commit introduces a handshake when initiating a light
connection. During this handshake, node information, cluster name, and
version are received from the target node of the connection. This
information can be used to immediately validate that the target node is
a member of the same cluster, and used to set the version on the
stream. This will allow us to extend APIs that are used during initial
cluster recovery without a major version change.

Relates #15971
2016-05-04 20:06:47 -04:00
Christoph Büscher 5a0cfdd6af Change scriptFields member in InnerHitBuilder to set
Adding random shuffling of xContent to InnterHitBuilderTests shows
that the scriptFields are stored in order as a list internally although
they are an unordered json objects in the query dsl.

This changes the internal representation to a set and updates
serialization accordingly.
2016-05-04 17:43:15 +02:00
Christoph Büscher 223d67df4a Consolidate query generation in QueryShardContext
Currently we have a lot of methods left in QueryShardContext that
take parsers or BytesReference arguments to do some xContent
parsing on the shard. While this still seems necessary in some cases
(e.g. percolation, phrase suggester), the shard context should only
be concerned with generating lucene queries from QueryBuilders.

This change removes all of the parseX() methods in favour of two
public methods toQuery(QueryBuilder) and toFilter(QueryBuilder) that
either call the query builders toFilter() or toQuery() method and
move all code required for parsing out to the respective callers.
2016-05-04 16:52:30 +02:00
Jim Ferenczi 8d3427b44d Fix build: restore illegalScorer still in use in ExpressionSearchScript (2) 2016-05-04 16:48:08 +02:00
Jim Ferenczi c4554fedad Fix build: restore illegalScorer still in use in ExpressionSearchScript 2016-05-04 16:46:44 +02:00
Jim Ferenczi 52eb6f3830 Merge pull request #18127 from jimferenczi/breadth_first_needs_score
Add the ability to use the breadth_first mode with nested aggregations (such as `top_hits`) which require access to score information.
2016-05-04 15:57:08 +02:00
Jason Tedor 78d615f320 Merge pull request #18110 from jasontedor/strings-split-as-array
Remove Strings#splitStringToArray

Remove arbitrary separator/wildcard from PathTrie
2016-05-04 09:38:47 -04:00
Jim Ferenczi 052191f2a2 Add the ability to use the breadth_first mode with nested aggregations (such as `top_hits`) which require access to score information.
The score is recomputed lazily for each document belonging to a top bucket.
Relates to #9825
2016-05-04 15:35:45 +02:00
Jason Tedor 9fe5ce9342 Remove arbitrary separator/wildcard from PathTrie
PathTrie has a constructor that allows for an arbitrary separtor and
wildcard, but this constructor is unused and internally we always use
'/' as the separator and '*' as the wildcard. There are no tests for the
case where the separator differs from the default separator and
wildcard. This commit removes this constructor and now all instances of
PathTrie have the default separator and wildcard.
2016-05-04 09:18:30 -04:00
Jason Tedor 2dea449949 Remove Strings#splitStringToArray
This commit removes the method Strings#splitStringToArray and replaces
the call sites with invocations to String#split. There are only two
explanations for the existence of this method. The first is that
String#split is slightly tricky in that it accepts a regular expression
rather than a character to split on. This means that if s is a string,
s.split(".")  does not split on the character '.', but rather splits on
the regular expression '.' which splits on every character (of course,
this is easily fixed by invoking s.split("\\.") instead). The second
possible explanation is that (again) String#split accepts a regular
expression. This means that there could be a performance concern
compared to just splitting on a single character. However, it turns out
that String#split has a fast path for the case of splitting on a single
character and microbenchmarks show that String#split has 1.5x--2x the
throughput of Strings#splitStringToArray. There is a slight behavior
difference between Strings#splitStringToArray and String#split: namely,
the former would return an empty array in cases when the input string
was null or empty but String#split will just NPE at the call site on
null and return a one-element array containing the empty string when the
input string is empty. There was only one place relying on this behavior
and the call site has been modified accordingly.
2016-05-04 08:12:41 -04:00
Isabel Drost-Fromm 283a6d27f1 Clean up merge commit changes 2016-05-04 13:34:11 +02:00
Isabel Drost-Fromm 3bc926b7e0 Merge branch 'master' into enhancement/switch_geodistancesortbuilder_to_geovalidationmethod 2016-05-04 13:16:40 +02:00