Commit Graph

9669 Commits

Author SHA1 Message Date
Martijn van Groningen 62da59f76f [TEST] Verify if clear cache request went to all shards. 2014-07-16 13:48:39 +02:00
Colin Goodheart-Smithe 8260138e59 Aggregations: Fixed Histogram key_as_string bug
The key as string field in the response for the histogram aggregation will now only show if format is specified on the request.

Closes #6655
2014-07-16 11:36:48 +01:00
Brian Murphy d6cd2c2b73 [DOCS][FIX] Fix reference check in indexed scripts/templates doc. 2014-07-16 11:24:18 +01:00
Brian Murphy bc570919ee [DOCS][FIX] Fix doc parsing, broken closing block 2014-07-16 11:18:21 +01:00
Brian Murphy cbd2a97abd [DOCS] : Indexed scripts/templates
These are the docs for the indexed scripts/templates feature.
Also moved the namespace for the REST endpoints.

Closes #6851
2014-07-16 10:49:02 +01:00
Adrien Grand 7e44fe6017 [TESTS] Stabilize DisabledFieldDataFormatTests by setting number_of_replicas to 0. 2014-07-16 10:37:25 +02:00
Boaz Leskes 84ad29ddfa [Recovery] don't start a gateway recovery if source node is not found
Due to change introduced in #6825, we now start a local gateway recovery for replicas, if the source node can not be found. The recovery then fails because we never recover replicas from disk.

Closes #6879
2014-07-16 10:01:01 +02:00
Boaz Leskes d869163b66 [Infra] re-send failed shard messages when receiving a cluster state that still refers to them
In rare cases we may fail to send a shard failure event to the master, or there is no known master when the shard has failed (ex. a couple of node leave the cluster canceling recoveries and causing a master to step down at the same time). When that happens and a cluster state arrives from the (new) master we should resend the shard failure in order for the master to remove the shard from this node.

Closes #6881
2014-07-16 09:59:49 +02:00
Martijn van Groningen f1c2cdb9c8 Store: Only send shard exists requests if shards exist locally on disk and are not allocated on that node according to the cluster state.
Closes #6870
2014-07-16 08:23:32 +01:00
Ryan Ernst 35037e31b2 [AGGS] Pass current docid being processed to scripts.
Scripts may internally cache based on docid (as expressions do). This
change makes numeric aggregations using scripts pass the docid when
it changes.
2014-07-15 14:40:12 -07:00
Shay Banon 323210729e Releasable XContentBuilder
make the builder releasable (auto closeable), and use it in shards state
also make XContentParser releasable (AutoCloseable) and not closeable since it doesn't throw an IOException
closes #6869
2014-07-16 04:28:03 +09:00
Shay Banon 9345194a65 Share numeric data analyzer instances between mappings
use similar mechanism that shares numeric analyzers for long/double/... for dates as well. This has nice memory save properties with many date fields mapping case, as well as analysis saves (thread local resources)
closes #6843
2014-07-16 04:24:52 +09:00
Ryan Ernst e764c5f08a Fix transient testScore failure by making DF consistent for query. 2014-07-15 11:18:13 -07:00
Brian Murphy 86dfad24fe [FIX] normalize serialization of ScriptType in UpdateRequest 2014-07-15 18:14:48 +01:00
Nik Everett da5fb34163 Mappings: Add transform to document before index.
Closes #6566
2014-07-15 18:40:46 +02:00
mikemccand 63cab559e3 Docs: explain that SerialMergeScheduler just maps to CMS for back compat
Closes #6878
2014-07-15 11:38:43 -04:00
Adrien Grand 56cfa8e47e [TEST] Enforce that the node from ElasticsearchSingleNodeTest is alone in its cluster.
In particular, this removes the ability to create new node and adds the ability
to get a reference to the single node that the cluster is made of.
2014-07-15 17:26:52 +02:00
mikemccand ba443a4819 Test: make test less evil so it doesn't take so long 2014-07-15 11:19:18 -04:00
Simon Willnauer 05d92b9b68 [TEST] Enforce provided settings in test base classes
Enviorment variables might override the tests settings even if
they are explicitly set. Other base classes like InternalTestCluster
also specify `config.ignore_system_properties: true` to ensure `what
we set is what we get`
2014-07-15 17:06:20 +02:00
Ryan Ernst 64ab22816c Scripting: Add script engine for lucene expressions.
These are javascript expressions, which can only access numeric
fielddata, parameters, and _score. They can only be used for searches (not document updates).

closes #6818
2014-07-15 07:49:01 -07:00
Simon Willnauer 1464bea00f Added [1.4.0] version 2014-07-15 16:16:50 +02:00
Simon Willnauer 3900d61254 [TESTS] Add ElasticsearchSingleNodeTest.
This test makes it easy to create a lightweight node (no http, indices stored
in RAM, ...) whose main purpose is to get an instance of the Guice injector
for unit tests.

This should help not have to update lots of unit tests when we add a new
Guice dependency.
2014-07-15 15:42:58 +02:00
Patrick Peschlow 9742d08f53 [UPDATE] Handle document missing exception on retry correctly.
Throwables thrown on update retries are now caught and handled via
the provided callback. This commit also contains an integration test
demonstrating the bug and validating the fix.

Closes #6355
Closes #6724
2014-07-15 14:52:29 +02:00
javanna 3c54eb9b8f Internal: make transport action name available in TransportAction base class
Each transport action is associated with at least an action name, which is the action name that gets serialized together with the request and identifies what to do with the request itself. Also, the action name is the name of the registered transport handler that handles incoming request for the transport action.

This commit makes the action name available in a generic manner in the TransportAction base class, so that it can be used when needed by subclasses, or in the base class for instance for action filtering.

Closes #6860
2014-07-15 14:35:35 +02:00
mikemccand 4194ab31c8 Core: don't close/reopen IndexWriter when changing RAM buffer size
Today we close/reopen IW when we change the RAM buffer but that's
costly because it means the next NRT reader is a full reopen.  The RAM
buffer size setting is a live one in IndexWriter, even if there are no
buffered docs in RAM when you call it.

Separately it would be nice if Lucene let you manage a "reader pool"
that could outlive individual IW instances ...

Closes #6856
2014-07-15 08:32:30 -04:00
Simon Willnauer 557b634f4a [SEARCH] Wrap filter only once in ApplyAcceptedDocsFilter
We potentially wrap the given filter multiple times when iterating the
subreaders. We only need to do this once.

Closes #6873
2014-07-15 12:44:35 +02:00
Simon Willnauer 7de9d3d2cb [TEST] Fix test to use keyword analyzer since it relies on exact terms without processing 2014-07-15 12:26:51 +02:00
Simon Willnauer 82cc227da3 Added missing version based serialization 2014-07-15 12:13:45 +02:00
Brian Murphy 73d93e5fd8 Indexed Scripts/Templates: cleanup
This commit cleans up some code around the indexed script/templates feature.
Remove dead code in ScriptService.
Remove setXScript methods for UpdateRequestBuilder and use setScript(script,type) instead
2014-07-15 10:49:39 +01:00
Simon Willnauer 2bac455cd0 Add version check before reading script type in UpdateRequest 2014-07-15 10:16:08 +02:00
Simon Willnauer 70bd24ed14 [TEST] use higher timeout to wait for balanced cluster
CorruptFileTest sometimes hits conditions where lots of rebalancing
happens. In such a case the default timeout is just not enough - this
timeout just makes sure that the cluster has enough time to balance
itself.
2014-07-15 09:56:41 +02:00
Areek Zillur 0bd774423d [TEST] fix random preference string tests to accomodate for the new more strict preference type 2014-07-14 20:15:00 -04:00
Areek Zillur d0d1b98d23 Stats: Expose IndexWriter and VersionMap RAM usage to ShardStats and _cat endpoint
This commit adds the RAM usage of IndexWriter and VersionMap

Closes #6483
2014-07-14 19:46:12 -04:00
Areek Zillur 4fb79fe787 [TEST] fix random preference string test to accomodate for the new more strict preference type 2014-07-14 19:01:04 -04:00
Areek Zillur 0173298f29 [TEST] fix PhraseInIndex test bug for shard failure 2014-07-14 17:12:51 -04:00
Areek Zillur 76343899ea Phrase Suggester: Add collate option to PhraseSuggester
The newly added collate option will let the user provide a template query/filter which will be executed for every phrase suggestions generated to ensure that the suggestion matches at least one document for the filter/query.
The user can also add routing preference `preference` to route the collate query/filter and additional `params` to inject into the collate template.

Closes #3482
2014-07-14 16:07:52 -04:00
Simon Willnauer f8be82f54a [TEST] close IW before listing directory content 2014-07-14 22:00:03 +02:00
uboness 04b412b597 Added more utility methods to Settings
- names() to return the direct settings names
- getAsSettings(String) to return the settings mapped to the given name (like getByPrefix(...) except no need to provide a tailing '.')
2014-07-14 20:25:35 +02:00
mikemccand f392a99bd9 Test: add diagnostics to get some details next time this test fails 2014-07-14 13:48:56 -04:00
Brian Murphy f68a06ff99 [TEST] Fix test relying on order of json for matching 2014-07-14 17:06:23 +01:00
Brian Murphy 9c0b25dcce [TEST] Fix test issues with branches still using mvel as default scripting language 2014-07-14 16:51:17 +01:00
Simon Willnauer c91ec7c730 [TEST] fix compile problems on Java 8 2014-07-14 17:17:24 +02:00
Malte Schirnacher 647a2a64a1 Docs: Update query-string-syntax.asciidoc
Closes #6853
2014-07-14 16:35:17 +02:00
Brian Murphy e79b7086de Indexed Scripts/Templates: Add support for storing/deleting/getting scripts/template from an index.
This change allow elasticsearch users to store scripts and templates in an index for use at search time.
Scripts/Templates are stored in the .scripts index. The type of the events is set to the script language.
Templates use the mustache language so their type is be "mustache".
Adds the concept of a script type to calls to the ScriptService types are INDEXED,INLINE,FILE.
If a script type of INDEXED is supplied the script will be attempted to be loaded from the indexed, FILE will
look in the file cache and INLINE will treat the supplied script argument as the literal script.
REST endpoints are provided to do CRUD operations as is a java client library.
All query dsl points have been upgraded to allow passing in of explicit script ids and script file names.
Backwards compatible behavior has been preserved so this shouldn't break any existing querys that expect to
pass in a filename as the script/template name. The ScriptService will check the disk cache before parsing the
script.

Closes #5921 #5637 #5484
2014-07-14 14:37:55 +01:00
Boaz Leskes dcb2107a1d [Test] testSingleNodeWithFlush should wait for yellow
O.w. it can restart a node before all primaries are started , leading to a red state down the road...
2014-07-14 15:13:52 +02:00
mikemccand 80774877ff Test: add test case verifying updating merge IO throttle settings works
Closes #6842
2014-07-14 08:37:29 -04:00
Martijn van Groningen b275393e01 [TEST] For connection rules make TransportAddress the identity instead of DiscoveryNode.
For unicast ping the DiscoveryNode identity is based on its id, which in that stage is a dummy value, this breaks any rule in the mock tran
However the TransportAddress is a valid value in unicast ping and all other places, so that is a better alternative.

Closes #6836
2014-07-14 12:52:45 +02:00
Clinton Gormley 6e70edb0a4 Analysis: Improve Hunspell error messages
The Hunspell service would throw a confusing error message if more than
one affix file was present.  This commit distinguishes between the two
error cases: where there are no affix files and when there are too many
affix files.

Also implements lazy dictionary loading, which was used in the tests
but not implemented.

Closes #6850
2014-07-14 12:13:32 +02:00
Britta Weber 74927adced significant terms: infrastructure for changing easily the significance heuristic
This commit adds the infrastructure to allow pluging in different
measures for computing the significance of a term.
Significance measures can be provided externally by overriding

- SignificanceHeuristic
- SignificanceHeuristicBuilder
- SignificanceHeuristicParser

closes #6561
2014-07-14 11:00:50 +02:00
Boaz Leskes 8865e60e93 [Transport] possible NPE during shutdown for requests using timeouts
Closes #6849
2014-07-14 10:52:29 +02:00