3250 Commits

Author SHA1 Message Date
Igor Motov
649f1b13da Initial implementation of custom _all field
Closes #4520
2014-01-20 10:44:33 -05:00
Adrien Grand
af1513f908 Add page tracking to MockPageCacheRecycler.
This found an issue in BytesRefHash that forgot to release the start offsets.

Close #4814
2014-01-20 16:23:37 +01:00
Adrien Grand
3586157467 Make StringFieldMapper.toXContent aware of defaults for not_analyzed fields.
StringFieldMapper.toXContent uses the defaults for analyzed fields in order to
know which options to add to the builder. This means that if the field is not
analyzed and has norms enabled, it will omit to emit `norms.enabled: true`.
Parsing the mapping again will result in a StringFieldMapper that has norms
disabled.

The same fix applies to index options.

Close #4760
2014-01-20 16:15:30 +01:00
Adrien Grand
6469f6ef06 Return a conflict when trying to enable/disable norms.
Close #4761
2014-01-20 16:13:58 +01:00
Simon Willnauer
f0bce08c30 Return MatchNoDocsQuery if query string is emtpy
Closes #3952
2014-01-20 16:08:57 +01:00
Luca Cavanna
c8d661608c Follow-up of #4808, same fix applied to ToXContent.MapParams 2014-01-20 15:40:40 +01:00
Alexander Reelsen
53dab85fa2 Fix logging on immediate exit on start
If elasticsearch was started in the foreground an immediate exit on startup
led to logging in the logfile, where as when starting in the background,
an immediate exit logged to stdout.

Closes #4805
2014-01-20 15:31:54 +01:00
Luca Cavanna
32428bf683 Accept the same boolean values in RestRequest
Added `no` as a possible value to `paramBooleanAsOptional`, also reused existing code from `Booleans.parseBoolean`

Closes #4808
2014-01-20 14:27:35 +01:00
Luca Cavanna
55a247e257 master_timeout parameter is now taken into account when calling cluster pending tasks api through the REST layer
Closes #4806
2014-01-20 12:53:55 +01:00
Luca Cavanna
3a558972b2 Added base Request class for read operations that usually happen on the master but can be executed locally.
Added base TransportAction class for master read operations that execute locally or not depending on the request class (local flag).

Added support for local flag where missing, in a backwards compatible manner:
     - IndicesExistsRequest
     - GetAliasesRequest (get alias api, aliases exist api)
     - TypesExistsRequest
     - GetIndexTemplatesRequest (get template, template exists)
     - GetSettingsRequest
     - GetRepositoriesRequest
     - PendingClusterTasks

 Added parsing of the local flag where missing in Rest*Action.

 Updated SPEC adding local flag param where missing and added REST tests that contain use of the local flag where it was just added.

Closes #3345
2014-01-20 12:35:48 +01:00
Luca Cavanna
8b2fe44fe3 [TEST] Better fix for missing create spec
create is a shortcut to index with op_type=create that the clients support
2014-01-20 12:10:43 +01:00
Adrien Grand
62b044697a Fix test bug: test expects at least one child document. 2014-01-20 11:56:27 +01:00
Luca Cavanna
3d0c06e2f4 [TEST] Added create api (hardcoded) to REST tests suite as it has no spec but it's just a variation of the index api 2014-01-20 11:51:23 +01:00
Martijn van Groningen
5bc2a39763 [TESTS] Mapping update might get applied before the first document is indexed on replica, so it is better not to check if the new field isn't available before re-indexing first document. 2014-01-20 11:49:52 +01:00
Matthias Wahl
c42f7708be fix IndexOutOfBoundsException on _all field without tokens and keyword analyzer
fix AllEntries to only compute boost when there are actually some Entries available for the _all field

Closes #4771
2014-01-20 11:27:58 +01:00
Martijn van Groningen
a7a2f4747d Consume the entire weight and pre compute the DocIdSets for all segments instead of keeping the weight around and build a DocIdSet when a segment is being processed. This fixes issues where the has_child / has_parent filter produce no results or errors on subsequent scan requests.
Also made CustomQueryWrappingFilter implement Releasable in order to cleanup the pre-computed DocIdSets.

Closes #4703
2014-01-20 11:08:29 +01:00
Martijn van Groningen
db394117c4 Made sure that any filter that wraps a p/c filter (has_child & has_parent) either directly or indirectly will never be cached by making CustomQueryWrappingFilter extend from NoCacheFilter.
Closes #4757
2014-01-20 10:54:09 +01:00
Simon Willnauer
0e418d18a4 Added no-cache infrastucture the the filter cache.
During query parsing if a filter is encountered that extends from NoCacheFilter then the filter will not be given to the filter cache (also not wrapped in FilterCacheFilterWrapper).
Also if a filter directly or indirectly wraps a NoCacheFilter then that filter will also not be cached.

Relates to #4757
2014-01-20 10:45:13 +01:00
Alexander Reelsen
e34a35244c [DOCS] Added documentation for CAT Aliases API
Added asciidoc. Added new lines in java class.
2014-01-20 09:23:00 +01:00
Simon Willnauer
67efe8777a Remove unnecessary optimize call that destabelizes test 2014-01-18 20:06:55 +01:00
Adrien Grand
6159343c61 Fix HistogramAggregationSearchBenchmark. 2014-01-17 22:29:27 +01:00
Andy Goldstein
b674827eb6 Add transport.publish_port setting
Add transport.publish_port setting to allow users to specify the port
other cluster members should use when connecting to an instance. This
is needed for systems such as OpenShift, where cluster communication
needs to use a publicly accessibly proxy port, because the normal port
(9300) is bound to a private loopback IP address.
2014-01-17 22:06:22 +01:00
Costin Leau
16a70d6005 apply line ending fix only on Windows
fix for #4785
2014-01-17 20:03:31 +02:00
Luca Cavanna
de893d80de [SPEC] Removed _source endpoint from get api spec, as the get_source is a different api already
Also removed custom code that was required in the REST tests due to this.
2014-01-17 18:05:07 +01:00
Simon Willnauer
42377db084 Check ThreadInfo[] for null element if thread are not alive.
If a thread is not alive getting ThreadMXBean#getThreadInfo(long[], int)
places null elemnents in the returned array which are not repected
in the HotTheards API.

Closes #4775
2014-01-17 17:14:19 +01:00
Luca Cavanna
3ac2f8c789 [TEST] fixed error message in REST tests runner 2014-01-17 16:41:19 +01:00
Luca Cavanna
841db7c295 Removed double masterNodeTimeout set in RestPutRepositoryAction 2014-01-17 15:39:42 +01:00
Andrew Raines
3f14725057 Use millis for joda DateTimeFormatter.print()
Fixes #4782.
2014-01-17 08:37:23 -06:00
Simon Willnauer
7f51fbc5ab Add SecurityManger / policy when running tests.
This commit adds a security manager to the test JVMs
that prevents mainly writing files outside of the JVMs
current test directory.
2014-01-17 15:15:10 +01:00
Simon Willnauer
da707b6f32 Remove omit_term_freq_and_positions for new indices
`omit_term_freq_and_positions` was deprecated in `0.20` and
is not documented anymore. We should reject indices that are
created with this option in the future.

Closes #4722
2014-01-17 14:46:48 +01:00
Simon Willnauer
0d8330b50a Cleanup tests - using assert method instead of assert keyword 2014-01-17 14:13:26 +01:00
Luca Cavanna
37faddcafa [TEST] Wipe templates is now done in a single call using wildcards (compared to cluster state + delete each template) 2014-01-16 21:59:37 +01:00
Luca Cavanna
ee1e5660e1 [TEST] Removed TODO and custom code now that ping and info are two different apis in the REST spec 2014-01-16 21:17:29 +01:00
Luca Cavanna
81846151f7 [TEST] Added params validation according to REST spec and check whether body is supported or required 2014-01-16 21:09:56 +01:00
Luca Cavanna
92a5d6a8af [TEST] Replaced File.separator with '/' as REST test suites can be loaded from classpath, where '/' is needed 2014-01-16 21:09:56 +01:00
Luca Cavanna
06057c6c39 [TEST] Added check: test section names must be unique in the same REST test suite
Fixed also three duplicates found
2014-01-16 21:09:55 +01:00
Luca Cavanna
b5f4b2444c [TEST] Left '.' as it is in REST suites and sections titles (was previously replaced with '_')
With JUnit up to 4.10 there's no way to distinguish between what's shown in IDEs and test ids that need to be unique. A test Description is identified by just a string, that needs to be unique and is shown by IDEs. IDEs have slightly different behaviours when it comes to showing tests and suites titles. Some IDE (e.g. IntelliJ) strips the description on '.', which is why the '.' was replaced in the first place, in order to obtain the same behaviour on all IDEs. On the other hand the information printed out by RestReproduceInfoPrinter was wrong as the file path contained a '_' instead of a '.', which made the string to reproduce a failure useless in some cases. At the end of the day it seems better to just keep the dots and accept slightly different behaviours that are IDE dependent.
2014-01-16 21:09:55 +01:00
Alexander Reelsen
1b8e1f5595 RPMs: Add timeout to shutdown with KILL signal
If the thread pools of an elasticsearch node cannot be shutdown
immediately, a wait of 10 seconds is added. This clashes with the
RPM scripts, as by default the init functions wait for 3 seconds
for a service to shutdown before a KILL signal is sent, resulting
in an unclean shutdown - not from an elasticsearch point of view,
but from init system point of view, as some lock files are left
around.

In order to prevent this the init script as well as the systemd
configuration now feature the same timeout than the debian package,
which is 20 seconds.

The await statement, which causes the 10 second delay can be found in
InternalNode.close()
2014-01-16 16:14:25 +01:00
Simon Willnauer
85ca6c6762 move to [1.0.0] SNAP 2014-01-16 10:28:38 +01:00
Martijn van Groningen
6dd5c80f04 Fixed test bug, was using value that wasn't generated. 2014-01-16 10:26:48 +01:00
Alexander Reelsen
c6155c5142 release [1.0.0.RC1] 2014-01-15 17:02:22 +00:00
David Pilato
baf3bd9224 Don't fail plugin manager test when downloading an actual plugin 2014-01-15 17:10:11 +01:00
Alexander Reelsen
353d599d05 Increased max map pages for systemd to align with init.d settings in packages 2014-01-15 14:57:00 +01:00
Britta Weber
6389432b28 Use most recent cluster state to find types in delete mapping
Previously, the cluster state before flushing was used to check which
types map the given types pattern. However, this state might not be
up to date. Instead use the more recent cluster state from clusterState.state()
This fixes a test failure of PercolatorTests.testDeletePercolatorType

Other changes:

- use BoolFilter instead of OrFilter, because it is faster
- throw exception immediately when no type matching the given patterns
  was found in cluster state
2014-01-14 23:06:11 +01:00
Alexander Reelsen
a3abcdc93a Consistent APIs: Get field mapping API includes 'mappings'
The get field mapping API now includes a mappings element after the index in its JSON

Added more consistent endpoint /{index}/_mapping/{type}/field/{fields}
and added endpoint /_mapping/{type}/field/{fields}
which are also used in tests

Added rest spec tests for wildcards and _all

Relates #4071

NOTE: This is not yet complete for 1.0. We need to return an empty JSON document instead
of a 404 if the field of an existing index and type is not found. However this is not
possible with the current data structure being returned. Needs to be finished for 1.0.
2014-01-14 22:42:27 +01:00
Alexander Reelsen
349a8be4fd Consistent REST API changes for GETting data
* Made GET mappings consistent, supporting
  * /{index}/_mappings/{type}
  * /{index}/_mapping/{type}
  * /_mapping/{type}
  * Added "mappings" in the JSON response to align it with other responses
* Made GET warmers consistent, support /{index}/_warmers/{type} and /_warmer, /_warner/{name}
  as well as wildcards and _all notation
* Made GET aliases consistent, support /{index}/_aliases/{name} and /_alias, /_aliases/{name}
  as well as wildcards and _all notation
* Made GET settings consistent, added /{index}/_setting/{name}, /_settings/{name}
  as well as supportings wildcards in settings name
* Returning empty JSON instead of a 404, if a specific warmer/
  setting/alias/type is missing
* Added a ton of spec tests for all of the above
* Added a couple of more integration tests for several features

Relates #4071
2014-01-14 22:33:52 +01:00
Andrew Raines
b35ca1aa75 Fix disk percent used calc in cat/allocation
Closes #4670.
2014-01-14 15:23:19 -06:00
Andrew Raines
158483554d Shorten epoch to second precision.
Closes #4696.
2014-01-14 15:23:19 -06:00
Simon Willnauer
fb3ea1feb0 Use assertThat instead of plain asserts in MemoryCircuitBreakerTests 2014-01-14 20:38:03 +01:00
Britta Weber
411739fe3b Make PUT and DELETE consistent for _mapping, _alias and _warmer
See issue #4071

PUT options for _mapping:

Single type can now be added with

`[PUT|POST] {index|_all|*|regex|blank}/[_mapping|_mappings]/type`

and

`[PUT|POST] {index|_all|*|regex|blank}/type/[_mapping|_mappings]`

PUT options for _warmer:

PUT with a single warmer can now be done with

`[PUT|POST] {index|_all|*|prefix*|blank}/{type|_all|*|prefix*|blank}/[_warmer|_warmers]/warmer_name`

PUT options for _alias:

Single alias can now be PUT with

`[PUT|POST] {index|_all|*|prefix*|blank}/[_alias|_aliases]/alias`

DELETE options _mapping:

Several mappings can be deleted at once by defining several indices and types with

`[DELETE] /{index}/{type}`

`[DELETE] /{index}/{type}/_mapping`

`[DELETE] /{index}/_mapping/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_mapings` can be used.

DELETE options for  _warmer:

Several warmers can be deleted at once by defining several indices and names with

`[DELETE] /{index}/_warmer/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_warmers` can be used.

DELETE options for _alias:

Several aliases can be deleted at once by defining several indices and names with

`[DELETE] /{index}/_alias/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_aliases` can be used.
2014-01-14 20:02:43 +01:00