Commit Graph

2565 Commits

Author SHA1 Message Date
Adrien Grand 7674f1edd4 Use Locale.ROOT by default to parse dates instead of the system locale.
Closes #3852.
2013-10-11 09:01:39 +02:00
Simon Willnauer 285f165100 Allow 'index.compound_on_flush' to be dyncamically changed 2013-10-10 19:01:32 +02:00
Martijn van Groningen 6163c7d8e5 Serialization improvement 2013-10-10 17:07:31 +02:00
Martijn van Groningen 1792bd6b16 Fixed serialization error. POST_RECOVERY is now also serialized 2013-10-10 16:15:33 +02:00
Simon Willnauer ec809200f0 Add Random MergePolicy via index templates in integration tests
This commit adds support for random merge policies set for every
index created in an AbstractIntegrationTest. It will either set
'logbyte', 'logdoc' or 'tiered' merge policy as well as a random
value for compound files.
2013-10-10 15:12:35 +02:00
Martijn van Groningen ec6539df37 In the delete by query also acquire a searcher when shard state is RECOVERING and POST_RECOVERING 2013-10-10 14:02:33 +02:00
Simon Willnauer e14e2a6597 Added IndexRequest#source(Object...) input validation
Added checks to IndexRequest#source(Object...) to ensure and even number
of parameters. This method otherwise throws an AIOOBException which is
confusing to users and doesn't report the root cause of the problem.
2013-10-10 11:16:39 +02:00
Martijn van Groningen d5a1eb3758 moved AwaitsFix to class level 2013-10-10 10:29:39 +02:00
Boaz Leskes 2cd1f53f69 Added an AwaitsFix to testDeleteAllOneIndex. Martijn is on it. 2013-10-10 08:52:11 +02:00
Simon Willnauer 15b4d70298 Add AssertingTransport that deploys basic BW-Compat serialization checks 2013-10-09 18:27:26 +02:00
Simon Willnauer a15f149dc6 Fix GetIndexTemlatesRequest if serialized with includeAll and a old ES version 2013-10-09 18:26:26 +02:00
Adrien Grand 4fa8f6f61f Doc values integration.
This commit allows for using Lucene doc values as a backend for field data,
moving the cost of building field data from the refresh operation to indexing.
In addition, Lucene doc values can be stored on disk (partially, or even
entirely), so that memory management is done at the operating system level
(file-system cache) instead of the JVM, avoiding long pauses during major
collections due to large heaps.

So far doc values are supported on numeric types and non-analyzed strings
(index:no or index:not_analyzed). Under the hood, it uses SORTED_SET doc values
which is the only type to support multi-valued fields. Since the field data API
set is a bit wider than the doc values API set, some operations are not
supported:
 - field data filtering: this will fail if doc values are enabled,
 - field data cache clearing, even for memory-based doc values formats,
 - getting the memory usage for a specific field,
 - knowing whether a field is actually multi-valued.

This commit also allows for configuring doc-values formats on a per-field basis
similarly to postings formats. In particular the doc values format of the
_version field can be configured through its own field mapper (it used to be
handled in UidFieldMapper previously).

Closes #3806
2013-10-09 16:34:30 +02:00
Luca Cavanna 897084d5c2 Added QueryBuilders#fuzzyQuery method that accepts value parameter as an object
Fixed javadocs

Closes #3616
2013-10-09 11:35:31 +02:00
Martijn van Groningen 1f117c194c Support the `has_child`, `has_parent`, `top_children` queries (and filters) in other apis than just search api. The queries are also now supported in count, explain (return dummy explination) and delete by query apis.
Migrate SearchContext.Rewrite to Releasable. All the parent child queries are now implemented as Lucene queries and the state is kept in the Weight.
Completely disable caching for `has_child` and `has_parent` filters, this has never worked and it also can also never work. The matching docIds are cached per segment while the collection of parent ids is top level.

Closes #3822
2013-10-09 10:20:23 +02:00
Ben McCann 7953eed36a Fix comment grammar 2013-10-09 10:04:37 +02:00
Adrien Grand 97958ed02a Improved warm-up of new segments.
* Merged segments are now warmed-up at the end of the merge operation instead
  of _refresh, so that _refresh doesn't pay the price for the warm-up of merged
  segments, which is often higher than flushed segments because of their size.
* Even when no _warmer is registered, some basic warm-up of the segments is
  performed: norms, doc values (_version). This should help a bit people who
  forget to register warmers.
* Eager loading support for the parent id cache and field data: when one
  can't predict what terms will be present in the index, it is tempting to use
  a match_all query in a warmer, but in that case, query execution might not be
  much faster than field data loading so having a warmer that only loads field
  data without running a query can be useful.

Closes #3819
2013-10-08 23:06:55 +02:00
David Pilato 88a2f54dfe plugin -remove deletes bin directory
Adding test for #3847.
2013-10-08 16:19:10 +02:00
David Pilato 4ee7f3521f plugin -remove deletes bin directory
I tried to install a plugin directly from disk, but used the wrong arguments. Totally my fault for not RTFM properly.

However, by following the instructions printed out by `bin/plugin`, I ended up deleting my $ES/bin directory.

```
$ pwd
/tmp/elasticsearch-0.90.5
$ ls
LICENSE.txt    NOTICE.txt     README.textile bin            config         lib
$ bin/plugin --install file:///tmp/foo.zip
-> Installing file:///tmp/foo.zip...
Failed to install file:///tmp/foo.zip, reason: plugin directory /tmp/elasticsearch-0.90.5/plugins already exists. To update the plugin, uninstall it first using -remove file:///tmp/foo.zip command
$ bin/plugin -remove file:///tmp/foo.zip
-> Removing file:///tmp/foo.zip
Removed file:///tmp/foo.zip
$ ls
LICENSE.txt    NOTICE.txt     README.textile config         lib
```

I reproduced the problem in 0.90.5 and the latest master.
Closes #3847.
2013-10-08 15:52:59 +02:00
Adrien Grand 6b02611971 Update Lucene to version 4.5.0. 2013-10-08 15:44:03 +02:00
Boaz Leskes a10c195667 Add FieldMappers before adding Mappers (used for parsing) and while holding the relevant's ObjectMapper mutex
Adding the mappers first could cause the wrong FieldMappers to be used during object parsing

Also:
Removed MergeContext.newFieldMappers, MergeContext.newObjectMappers and relatives as they are not used anymore.
Similarly removed MergeContext.addFieldDataChange & fieldMapperChanges as they were not used.

Closes #3844
2013-10-08 09:51:33 +02:00
Alexander Reelsen a03013ea25 Remove @Required annotation
The @Required annotation is used for documentation purposes only anyway.
2013-10-07 17:25:18 +02:00
Alexander Reelsen abcf8fc0f7 Improve exception handling for river startup
Due to a change in 0.90 some exceptions may show up when starting a river,
even though this is not a problem as the shard has not been initialized
yet and a retry is scheduled.
2013-10-07 17:02:24 +02:00
Alexander Reelsen 19099ab3da Rejecting invalid fields inside of completion field
Only valid fields (input, output, weight and payload) are now allowed inside a completion field.
This makes sure that typos like "inputs" are caught on indexing.
2013-10-07 15:08:52 +02:00
Shay Banon e9d9ade10f Better logic ignoring filters when parsing
When parsing a filter, we effectively have a case where we need to ignore a filter. For example, when an "and" filter has no elements. Ignoring a filter is different compared to matching on all or matching on none, because an and filter with no elements should simply be ignored in the context of a bool filter for example, regardless if its used within a must or a must_not filter.

We should be consistent in our codebase when handling these use case. See also #3809

closes #3838
2013-10-07 11:12:47 +02:00
Shay Banon 1af38cf3f3 use the already used constant for match no filter 2013-10-07 09:56:49 +02:00
Simon Willnauer f73241ea79 Disable ConcurrentDynamicTemplateTests for now 2013-10-06 09:20:05 +02:00
Simon Willnauer 89f8b13e78 Add simple test for delete by field query 2013-10-05 17:41:06 +02:00
Simon Willnauer c947a0e6f4 fix typo - s/Deprected/Deprecated 2013-10-05 17:28:30 +02:00
Simon Willnauer e82437754b Warn users with IAE if pos_inc is disabled in 'stop' filter 2013-10-05 17:24:34 +02:00
Martijn van Groningen 427bc13272 Also clear handlesText 2013-10-03 23:57:11 +02:00
Martijn van Groningen 088e05b368 Migrate from Trove to Hppc. 2013-10-03 23:10:57 +02:00
Shay Banon 373e64b3eb improve thread pool rejection message 2013-10-03 07:42:09 -07:00
uboness c29f5afa79 added javadocs for builder and cleaned up support for `shard_size` on terms & terms_stats facets 2013-10-02 22:32:32 +02:00
uboness f3c6108b71 introduced support for "shard_size" for terms & terms_stats facets. The "shard_size" is the number of term entries each shard will send back to the coordinating node. "shard_size" > "size" will increase the accuracy (both in terms of the counts associated with each term and the terms that will actually be returned the user) - of course, the higher "shard_size" is, the more expensive the processing becomes as bigger queues are maintained on a shard level and larger lists are streamed back from the shards.
closes #3821
2013-10-02 22:02:00 +02:00
Nik Everett 6b000d8c6d Support specifing score query on highlight.
This is useful if you want to highlight terms not in the search query or
you want sort highlighted snippets based on another query.

Closes #3630
2013-10-02 15:46:24 -04:00
Simon Willnauer 9e7b3963d8 Return source string instead of calling an infinite recursive loop 2013-10-02 20:20:09 +02:00
Boaz Leskes 268e561287 Introduced shardStats on InternalIndicesService to expose shard level statistics.
Added a load_average_format=array|hash param to OsStats to allow serializing load averages into a hash (with keys 1m,5m, 15m).
Added node_info_format to NodeStats, allowing to suppress node info output
2013-10-02 11:15:18 +02:00
Martijn van Groningen 23c035da35 Use simple class name as cluster name 2013-10-02 10:36:37 +02:00
Simon Willnauer 9976f6b9aa Make testcase more reproducible 2013-10-01 17:32:20 +02:00
Boaz Leskes f747704249 Allow dynamic templates with match_mapping_type but no path_match or match.
As long as we have some selector we're good.

Closes #3814
2013-10-01 17:03:31 +02:00
Britta Weber f91fd3b9ed fix term vector api for missing payloads 2013-10-01 16:33:06 +02:00
Simon Willnauer f8a129961e s/Exception/Throwable 2013-10-01 15:58:28 +02:00
Simon Willnauer f3b6339ad1 Add more debug info to testcase 2013-10-01 15:58:28 +02:00
Simon Willnauer e826cfa494 StreamTests only work on 64Bit JVMs
32bit JVMs have different buffer grow behavior. We simply ingore this
since it's a lucene feature that is tested in the upstream project.
2013-10-01 15:58:28 +02:00
Boaz Leskes 4ddfe89bdb Improved index template tests, among other to test for getting all templates by not specifying a name. 2013-10-01 15:09:56 +02:00
Boaz Leskes b5ae1fb51b Calling `GET _template` gave a 500 error back.
Also:
We always return a valid json back
If there are no templates define we return 200 OK ( as opposed to a request for a specific template id which returns 404)

Closes #3812
2013-10-01 14:20:02 +02:00
Simon Willnauer 20423a43e7 Throw ESIA if required field 'patterns' is not present in filter config.
If 'pattern_capture' tokenfilter is create / mapped without a 'patterns'
settings we now throw an exception since this is a misconfiguration and
likely due to the similar settings on related token filters.

Closes #3808
2013-09-30 20:28:40 +02:00
Simon Willnauer 9cb55138c7 Cut over remaining tests to 'AbstractIntegrationTest' 2013-09-30 16:07:09 +02:00
Simon Willnauer 8b69035fa0 Catch EsRejectedExecException on cluster info reschedule 2013-09-30 16:03:37 +02:00
Shay Banon 9787562d27 catch indices lifecycle failures and log them
make sure we catch index/shard lifecycle failures, and properly log them
2013-09-30 13:39:20 +02:00
Simon Willnauer 1f906804ff Catch RejectedExceutionException in ZenPing et al.
If nodes are shutting down we close thread pools and throw
'EsRejectedExcutionException'. This commit handles these exceptions
gracefully if throw during Ping execution.
2013-09-30 11:10:54 +02:00
Shay Banon 6b6a468327 serialize timestamp on the response 2013-09-30 10:54:30 +02:00
Shay Banon 62a09fd207 additional places not to do field conversions 2013-09-30 10:39:14 +02:00
Simon Willnauer ea3ec926c9 Move Mock Store impls to test package 2013-09-28 22:16:34 +02:00
Simon Willnauer 6c54e030d4 Expose several options from MockDirWrapper via index settings
Index settings can now override default behavior for 'double write'
and 'no delete open files' on MockDirectoryWrapper if tests use these
options in a legit. way. ie. in a restore situation a double write
is a legit operation.
2013-09-28 22:05:22 +02:00
Simon Willnauer 831c3fabc6 cleanup testcase 2013-09-28 20:36:15 +02:00
Boaz Leskes 2f0271062a added a ToXContent implementation to NodeStats 2013-09-27 17:08:34 +02:00
Alexander Reelsen a18f47e62e Returning useful exception when sorting on a completion field
Closes #3747
2013-09-27 16:45:23 +02:00
uboness 4aa315974b introduced NodeSettingsSource in the test infrastructure os tests with scopes TEST & SUITE without an explicit numNodes definitions will fall back on the nodeSettings(int) callback 2013-09-27 16:09:36 +02:00
Boaz Leskes 1d7e20b712 Add indexUUID to mapping-updated and mapping-refresh events and make sure they are applied to an index with same UUID.
This can go wrong if indices with the same name are repeatably created and deleted.

UUIDs can not be null anymore. If UUID is not available `_na_` will be used as a value.

Also - some minor clean up in ShardStateAction where shard started events could be added twice to the to-be-applied list where the second instance will be ignored.

Closes #3783
2013-09-27 14:42:12 +02:00
Shay Banon 40aebfaf57 remove unused class 2013-09-27 10:10:08 +02:00
Boaz Leskes b66f3c6834 Send the update-mapping events before actually indexing into the shard, because the latter may generate exceptions (like when the shard is not yet ready to accept new docs).
Also improved the SimpleDeleteMappingTest, as it make take a while until the update-mapping event is processed.

Closes #3782
2013-09-26 14:37:12 +02:00
Shay Banon 48ca7b874d use the event cluster state to send events back to master
instead of relying on the current cluster state from the cluster service, make sure to rely on the cluster state we get from the change event, this will allow us to move processing of the cluster event around potentially to before the local cluster state has been updated
2013-09-26 14:04:59 +02:00
Bernhard K. Weisshuhn 93a2742c84 do not silently fail on plugin install with source files 2013-09-26 12:24:07 +02:00
Simon Willnauer 63fdbe9b9b Add more debug info to SimpleDeleteMappingTests 2013-09-25 23:56:38 +02:00
Boaz Leskes 1644444a4f Introduced an index UUID which is added to the index's settings upon creation. Used that UUID to verify old and delayed shard started/failed events are not applied to newer indexes with the same name.
Also, exceptions while processing batched events do not stop the rest of the events from being processed.

Closes #3778
2013-09-25 19:26:05 +02:00
Shay Banon 35990f572b fix to compile under 1.6 2013-09-25 18:02:13 +02:00
Simon Willnauer 500469fd28 Improve EngineSearcher tracking
Currently we fail tests is any searcher reference is pending. Yet,
on a slow machine the freeContext calls that are async could still be
in flight so if there are pending searchers we wait for a bit to make
sure we don't fail if a freeContext call is in flight.
The MockEngine now also contains the stack trace of the first close call
if a searcher is closed twice.
2013-09-25 14:18:34 +02:00
Shay Banon 57d6944f0f add assert to make sure we fix NamedAnalyzer when upgrading to Lucene 4.5 2013-09-25 13:38:45 +02:00
Simon Willnauer a958d2e4fd Added test for DateHistogram#factor
DateHistogramFacets can be used on fields that store dates in a numeric
(long) field using different resolutions like seconds instead of
milliseconds. This commit adds a test that checks if the factor is
applied correctly to scale it up to milliseconds.
2013-09-25 09:36:12 +02:00
Shay Banon 3772201845 add awaitfix on search while relocation with 0 replicas 2013-09-24 17:50:24 +02:00
Simon Willnauer df0112358d Acquire ReadLock before reading SegmentInfos in RobinEngine
Before reading segmentinfos we should aquire the read lock to prevent
reading the segment infos on an already closed robin engine.
2013-09-24 15:55:48 +02:00
Shay Banon 5b1f263569 add origin to failure message 2013-09-24 15:52:13 +02:00
Shay Banon 397f442c6d Introduce internal post recovery state
Introduce a new internal, index shard level, post recovery state, where the shard moves to when its done with recovery. The shard will now move to started only once the cluster state with its respective cluster state level state is started.

This change allow to have more fine grained control over when to allow reads on a shard, resolving potential refresh temporal visibility aspects while indexing and issuign a refresh. By only allowing reads on started shards, and making sure we refresh right before we move to started
2013-09-24 15:38:12 +02:00
Boaz Leskes 10de3a7ecb Moved RecoverAfterNodesTests to inherit from AbstractIntegrationTest 2013-09-24 14:32:41 +02:00
Shay Banon 0422f75c8d improve search while relocation
- add verification phase at the end of the test
- add explicit test for 0 replicas and 1 replica
2013-09-24 13:10:41 +02:00
Shay Banon 4370dfed76 Update Operation might hang (rarely) when retrying on invalid shard state
The retry logic when failing does not reset the operation started flag...
closes #3769
2013-09-24 13:01:45 +02:00
Andrew Raines 917a3c3b9d Migrate createIndex(). 2013-09-23 17:04:54 -05:00
Simon Willnauer 26334a7a61 Reenable MockEngineModul as default on TestCluster 2013-09-23 22:17:21 +02:00
Andrew Raines 362c3f7895 One too many... 2013-09-23 15:09:35 -05:00
Andrew Raines 16cde6f10a Remove redundant wipeIndices(). 2013-09-23 15:03:06 -05:00
Simon Willnauer e4af8c720c cut over more tests to AbstractIntegrationTest 2013-09-23 18:18:36 +02:00
Andrew Raines 291cb54c95 Fix misspelling. 2013-09-23 11:06:33 -05:00
Simon Willnauer ac5120e722 cut over more tests to AbstractIntegrationTest 2013-09-23 15:53:42 +02:00
Martijn van Groningen 8eab51047f Cut RecoveryPercolatorTests over to AbstractIntegrationTest
Added node restart capabilities to TestCluster
Trigger retry mechanism (onFailure method) instead of invoking transport service with null DiscoveryNode when no DiscoveryNode can be found for a ShardRouting.
2013-09-23 00:19:33 +02:00
Shay Banon e7e39936b8 add internal origin to delete by query 2013-09-22 23:56:30 +02:00
Simon Willnauer 0f17a4c61f disable 'SearchWhileCreatingIndexTests' for now - fix is already in the pipeline 2013-09-22 22:45:39 +02:00
Simon Willnauer 5a365795ec Added support for dynamic transport client ratio in tests.
Currently tests only run with node clients but eventually we want to
run all tests with randomly choosen node / transport clients. To enable
this during development and on test servers as a transition phase this
commit adds the ability to allow a fraction of the clients used in
tests to be transport clients. By default this is still disabled.
To enable transport clients in tests pass '-Dtests.client.ratio=[0..1]'
where '1.0' will force transport clients and '0.0' completely disables
them. If an empty string is passed the ratio is chosen at random for
each test.
2013-09-22 22:25:30 +02:00
Shay Banon ab6715b292 move the internal source for a refresh to be required 2013-09-22 20:24:05 +02:00
Shay Banon 78af818d72 add internal source to acquire searcher
add a source indicating why the searcher was acquired
2013-09-22 18:29:23 +02:00
Shay Banon 167538ef0d add internal source to refresh
can be used to more easily understand where its coming from
2013-09-22 17:58:40 +02:00
Alexander Reelsen 57f962d620 Add completion field support in Rest nodes stats
Closes #3746
2013-09-22 15:02:05 +02:00
Simon Willnauer 0909055e83 Cleanup Integration Tests 2013-09-22 12:05:58 +02:00
Simon Willnauer 4b5935a708 Small cleanups in TransportClient et.al
Catching Throwable instead of Exception in TransportClient
and TransportClientNodesService and restore interrupted flag
if interrupt exception is caught and ignored
2013-09-22 12:05:57 +02:00
Simon Willnauer 58ea539a26 Add missing TransportHandler for clear_sc (ClearScroll) 2013-09-22 12:05:57 +02:00
Simon Willnauer cadbcfeb24 Call validate in TransportClients before request is send 2013-09-22 12:05:57 +02:00
Simon Willnauer c8192dd1f2 Fail GetIndexTemplate if names it null or empty 2013-09-22 12:05:57 +02:00
Simon Willnauer e1aa91dc81 Add listener nodes to nodes list if 'sniff' is true
TransportClient doesn't add the initial nodes to the nodes list
if it doesn't retrieve any nodes from the listeners which can cause
the transport client to throw a 'NoNodeAvailableException' if the
'sniff' response didn't return any nodes. This situation can occure
if the client tries to get the listener nodes cluster state while that
node is not yet connected to any other nodes.
2013-09-22 12:05:57 +02:00
Martijn van Groningen 7c032f6af6 Fixed serialisation bug for multi percolate request and response classes.
This bug manifests when running with transport client.
2013-09-22 12:01:27 +02:00
Shay Banon 74e8d299d6 fix log to trace 2013-09-22 03:19:08 +02:00