Commit Graph

3294 Commits

Author SHA1 Message Date
Shay Banon debfb0e996 move helper class for allocation tests to base class 2013-12-30 14:23:34 +01:00
Shay Banon e67cad3127 Add build hash to nodes info API
also, add it to the cat nodes api
2013-12-30 13:59:56 +01:00
Adrien Grand 96cca039e9 Honor `includeDefaults` in GeoPointFieldMapper.
Close #4563
2013-12-30 13:46:19 +01:00
Adrien Grand 1654ae8937 Explicit doc_values setting.
Once doc values are enabled on a field, they can't be disabled.

Close #4560
2013-12-30 11:10:52 +01:00
Simon Willnauer 11c4218566 Start Test nodes sometimes without mock modules
We are mocking out some functionality to add assertions etc. or
randomize store types. We should randomly run with our defaults to make
sure we don't hide any potential problems.
2013-12-29 00:50:10 +01:00
Simon Willnauer a1e4258b21 Add @Slow annotation to bad apples 2013-12-29 00:03:14 +01:00
Simon Willnauer 3113203e9e Add test that throws exceptions during search execution
Currently we only test if readers are correctly released when exceptions
occur during reopen or flush. This commit adds a test that
randomly throws exceptions during the search execution ie. when Terms
are pulled or if a docs enum is created.
2013-12-28 23:58:02 +01:00
Luca Cavanna 08a077ffae re-enabled FileUtilsTests and REST tests as rest-api-spec has been added back
fixed rest-api-spec paths in TESTING docs

Relates to #4540 & #4376
2013-12-27 20:43:16 +01:00
Luca Cavanna 63cbc84393 removed rest-spec submodule and prepared project for same files added directly to the codebase (no submodule) within rest-api-spec
(temporarily disabled FileUtilsTests & REST tests as there's temporarily no rest-spec dir)

Relates to #4540 #4376
2013-12-27 20:36:12 +01:00
Adrien Grand 51bec4ec6c Add SLOPPY_ARC to GeoDistanceSearchBenchmark. 2013-12-27 15:48:24 +01:00
Simon Willnauer 1b35ae11bc Fix SuggestSearchTests to expect any order in the error message 2013-12-27 14:07:04 +01:00
Adrien Grand 55a5c26de8 Fix NPE in RangeAggregator 2013-12-27 12:48:55 +01:00
Adrien Grand 05448b6276 Doc values for geo points.
This commits add doc values support to geo point using the exact same approach
as for numeric data: geo points for a given document are stored uncompressed
and sequentially in a single binary doc values field.

Close #4207
2013-12-27 12:45:18 +01:00
Adrien Grand 9eb7441543 Make RangeAggregator a MULTI_BUCKETS aggregator.
Until now, RangeAggregator was a PER_BUCKET aggregator, expecting to be always
collected with owningBUcketOrdinal == 0. However, since the number of buckets
it creates is known in advance, it can be changed to a MULTI_BUCKETS aggregator
by just multiplying the bucket ordinal by the number of ranges.

This makes aggregations that have ranges as sub aggregations of PER_BUCKET
aggregators more efficient.

Close #4550
2013-12-27 12:43:25 +01:00
Simon Willnauer 1c2cb99751 Use RandomPicks to select a random array element 2013-12-27 12:35:57 +01:00
Simon Willnauer 11ceaccc20 Randomize node level setting per node not per cluster 2013-12-27 12:21:41 +01:00
Simon Willnauer f52a080eec Randomize CacheRecycler instance in TestCluster 2013-12-27 12:21:25 +01:00
Florian Schilling bc452dff84 * setup accurate GeoDistance Function
* adapt tests
* introduced default GeoDistance function
* Updated docs

closes #4498
2013-12-27 19:15:19 +09:00
Shay Banon 5821f90b2c cleanup cat nodes 2013-12-26 17:22:30 +01:00
Adrien Grand d0143703a1 Fix Aggregator.buildAggregation on MULTI_BUCKETS aggregators. 2013-12-26 11:38:14 +01:00
Adrien Grand f3c1a885fb Fix QueueRecycler.
Double-release protection added in 1c758b0b made QueueRecycler throw NPEs when
trying to recycle existing instances.
2013-12-26 10:49:58 +01:00
Adrien Grand a04d18d2d2 Use BINARY doc values instead of SORTED_SET doc values to store numeric data.
Although SORTED_SET doc values make things like terms aggregations very fast
thanks to the use of ordinals, ordinals are usually not that useful on numeric
data. We are more interested in the values themselves in order to be able to
compute sums, averages, etc. on these values. However, SORTED_SET is quite slow
at accessing values, so BINARY doc values are better suited at storing numeric
data.

floats and doubles are encoded without compression with little-endian byte order
(so that it may be optimizable through sun.misc.Unsafe in the future given that
most computers nowadays use the little-endian byte order) and byte, short, int,
and long are encoded using vLong encoding: they first encode the minimum value
using zig-zag encoding (so that negative values become positive) and then deltas
between successive values.

Close #3993
2013-12-26 09:58:00 +01:00
Boaz Leskes 6fbcd8f8ff Start the task timeout checking *after* adding it to the execution queue.
This prevents missing very short timeouts which fire before the calling thread had the chance to add the task to the queue and are therefore ignored. This is mostly of importance for testing where we explicitly want tasks to timeout and set it to a very low value.
2013-12-24 20:23:31 +01:00
Andrew Raines c6199b611e Need to make sure we always end up with a Cell, even if it's null.
Fixes #4544.
2013-12-24 11:01:01 -06:00
Shay Banon 1c758b0bb0 clear the list of releases once released
also double check that once a recycler is released, it can't be released again or used
2013-12-24 10:06:35 +01:00
Andrew Raines df39016e58 Add column separator for help output. 2013-12-23 22:26:28 -06:00
Andrew Raines 498e0b418a Round load avg in _cat/nodes. 2013-12-23 22:26:28 -06:00
Andrew Raines dd75020709 Turn off some columns by default in cat/nodes. 2013-12-23 22:26:28 -06:00
Andrew Raines 08ddfcd731 Add associative lookup of columns for arbitrary (and more intuitive) ordering.
% curl 'localhost:9200/_cat/nodes?v&headers=jdk,ip,name'
  jdk      ip        name
  1.7.0_40 127.0.0.1 Mordo, Karl

Closes #4433.
2013-12-23 22:26:27 -06:00
Andrew Raines c2b41f8ad9 Add table concatenation. 2013-12-23 22:26:27 -06:00
uboness 7b13f1932e - currently we make a few assumptions in the field data based aggregations base on which we decide on execution paths, e.g. initial buffer sizes we use for ordinal arrays.
- also, in geo distance, because it's based on range agg and that by default the order of the geo point per doc is unknown, always wrap it in a dedicated field data source which sorts the values if needed. But most of the times, a doc will be associated with a single point and therefore most of this wrapping is redundant and adds perf. cost for nothing.

- the idea here is for every request that "hits" a field data agg, we'll first iterate over the searchable segments and load their field data and compute the cross-segment info out of them. This info will be placed in the field context with which the value sources are created.

- we currently have some of this info on the IndexFieldData, but problem with getting it from there is that we may easily end up getting wrong info that originate in unsearchable segments.
2013-12-24 00:40:20 +01:00
Martijn van Groningen 682e9548c1 Release SearchContext releaseables also post match filters / queries. 2013-12-23 18:35:54 +01:00
Martijn van Groningen 27b53b8edf Fixed named filter and query support for the top_children, has_child and has_parent queries and filters.
Closes #4534
2013-12-23 13:53:20 +01:00
Martijn van Groningen 9c67be5181 Release parentDocs in TopChildrenQuery. 2013-12-23 13:12:50 +01:00
Simon Willnauer 27e89c2427 Added v0.90.9 2013-12-23 12:13:09 +01:00
Martijn van Groningen a3d6216f40 Make doc lookup in geo_shape filter and query consistent with terms lookup.
The `geo_shape filter and query` option in geo_shape filter and query has been replaced with the `path` option, which allows these filter and query to fetch shapes from within objects as well.

Closes #4486
2013-12-23 11:20:43 +01:00
Simon Willnauer 2d77e2a37e Disable SegmentReader ram usage by default even if -ea is provided 2013-12-23 11:01:11 +01:00
Alexander Reelsen e4244268fa Fix loading templates in config/ directory
The fixes introduced in #4235 and #4411 do not take into account, that a
template JSON in the config/ directory includes a template name, as opposed
when calling the Put Template API.

This PR allows to put both formats (either specifying a template name or not)
into files. However you template name/id may not be one of the template
element names like "template", "settings", "order" or "mapping".

Closes #4511
2013-12-22 21:37:50 +01:00
Boaz Leskes 5698f9d794 Added asserts to test validation failures presence in ClusterHealthResponse response 2013-12-22 10:21:07 +01:00
Igor Motov d92f573404 Optimize restore source JSON serialization
Don't print "restore_source":  null if restore source is null, omit entire line instead
2013-12-21 22:12:12 -05:00
Shay Banon 9b9ad1a603 fix forbidden API on lower case... 2013-12-22 00:14:06 +01:00
Shay Banon e5b19087cb fix lower case for windows tests 2013-12-22 00:08:14 +01:00
Shay Banon f47f224d33 make sure all integration tests use ElasticsearchIntegrationTest
- move ClusterSettingsTests to ElasticsearchIntegrationTest
- remove InternalNodeTests, we already have separate plugin tests that verify it
2013-12-21 23:26:32 +01:00
Shay Banon 30a0fc30d5 add randomized multi data path nodes tests 2013-12-21 23:01:22 +01:00
Boaz Leskes be27ed3a25 Added unit tests for ClusterIndexHealth and ClusterHealthResponse
Relates to #4528
2013-12-20 22:00:24 +01:00
Alexander Reelsen 0bef2c66a9 Reverting back to 0.90.7 config/templates loading behaviour
Closes #4511
2013-12-20 14:58:46 +01:00
Boaz Leskes bbffeb1b39 Counting shards was wrong if one of the indices was in the RED status
Closes #4528
2013-12-20 13:17:18 +01:00
Adrien Grand a7cfae4e7a Stricter parsing of aggregations.
- Only one aggregation type is allowed per aggregation definition.
 - Return an error in the parsers when an unknown field is encountered.

Close #4464
2013-12-20 09:51:25 +01:00
Shay Banon 5bf4e74647 Failed search on a shard tries a local replica on a network thread
When a search on a shard to a remove node fails, and then replica exists on the local node, then the execution of the search is done on the network thread. This is problematic since we need to execute it on the actual search thread pool, but can also explain #4519, where the get happens on the network thread and it waits to send the get request till the network thread we use is freed (deadlock...)
fixes #4526

note, re-enable the geo shape fetch test, this fix should solve it as well
2013-12-19 22:19:20 +01:00
Shay Banon 0c1c2dc671 Allow to enable / disable bloom filter loading on an index
Allow to have a new index level setting index.codec.bloom.load (default to true), that can control if the boom filters will be loaded or not. This is an updateable setting, that can be updated on a live index using the update settings API.

Note though, when this setting is updated, a fresh Lucene index will be reopened, causing associate caches to be dropped potentially.

closes #4525

Note, this change also disables the returning lucene ram usage stats, due to a bug in Lucene, relates to #4512
2013-12-19 21:32:14 +01:00
Simon Willnauer 80ed3d05bc Use a List of shards per shard ID rather than a set.
The shards in the set are mutated after they are added to the
set such that the hashcode doesn't fit anymore. For this reason
this used an identity hashset before but the downside of this is
that the iteration order is not deterministic. We can just use a list
since shard removal is a very rare action and the size of the list is
very small such that iteration is fast.
2013-12-19 19:55:29 +01:00
Shay Banon a92907c47e fix bloom filter posting format to get the fpp from the correct settings 2013-12-19 14:35:38 +01:00
Shay Banon 46d191c8d4 try and extract store directory also if its wrapped in a compound dir 2013-12-19 14:21:27 +01:00
Igor Motov 8c1073bb6e Update snapshot list when snapshot is deleted 2013-12-18 20:34:05 -05:00
Igor Motov aafd4ddfbd Add ability to specify base directory on the repository level
This change is needed to support multiple repositories per S3 bucket
2013-12-18 20:34:05 -05:00
Shay Banon 95ca06cf09 Add the memory used on segment/segments stats
The memory used for the Lucene index (term dict, bloom filter, ...) can now be reported per segment using the segments API, and on the segments flag on node/indices stats
closes #4512
2013-12-18 22:21:53 +01:00
Shay Banon 0a016716ed fix computation of ram bytes used in bloom filter posting format 2013-12-18 22:01:59 +01:00
Simon Willnauer 7969a719f7 s/he/it 2013-12-18 21:46:43 +01:00
Martijn van Groningen e7e1667a26 Make parsing strict for `geo_shape` query & filter and stricter for `common` query.
Closes #4508
2013-12-18 17:56:38 +01:00
Shay Banon bb4d3f55c0 Fix compilation on Java 8 + tests that rely on ordering
Note, we still have tests failing because of mvel compilation bugs, see more here: http://jira.codehaus.org/browse/MVEL-299
closes #4510
2013-12-18 17:52:19 +01:00
Simon Willnauer 9d8ab56c9b Add [0.90.8] release 2013-12-18 17:30:28 +01:00
Simon Willnauer d8dee92f98 Make BalancedAllocationDecider assignments deterministic
a previous change introduces an identity hashset that has non-deterministic
iteration order which kill the reproducibility of our unittests if they fail.
This patch adds back deterministic allocations.
2013-12-18 16:10:28 +01:00
Boaz Leskes 17e7d01753 Move XContent Rendering and Cluster Health Status calculations to ClusterHealthResponse 2013-12-18 15:24:01 +01:00
Shay Banon d5192ecd31 use the computed data structure to optimize the awareness allocation decider 2013-12-18 14:29:41 +01:00
Shay Banon 5827170d42 use the computed data structure to optimize the same shard allocation decider 2013-12-18 14:08:59 +01:00
Shay Banon f5d217c08e On node join, evict existing node(s) with the same transport address
Make sure to evict an existing node with the same transport address as a new node that joins. This can happen for example when there is a bug in a cluster state event handler, which causes the "old" node to not be evicted, or a load on the master node that will take time for the "old" node leaving to be processed.
closes #4503
2013-12-18 12:21:59 +01:00
Boaz Leskes 3c5106ae98 Added cluster health status to the Cluster Stats API
Relates to #4460
2013-12-18 12:03:49 +01:00
Simon Willnauer 314499cee0 Use existing datastructures from RoutingNodes to elect unassigned primaries
Currently we trying to find a replica for a primary that is allocated by
running through all shards in the cluster while RoutingNodes already has
a datastructure keyed by shard ID for this. We should lookup this
directly rather than using linear probing. This improves shard allocation performance
by 5x.
2013-12-18 11:48:21 +01:00
Shay Banon f0356b2126 Don't delete local shard data when its allocated on a node that doesn't exists
This is an extreme case, exposed by a bug we had in our allocation in local gateway, causing a cluster state that doesn't include a node in the nodes list, but still has the shard in the routing table pointing at the non existent node. Then, when a node on the same box comes back, it will cause the local shard data to be deleted because it thinks its fully allocated on other nodes.
fixes #4502
2013-12-18 11:37:00 +01:00
Boaz Leskes b865047125 Removed exception handling in InternalIndexShard.docStats() & storeStats()
This is already caught at another level, see #4203
2013-12-18 11:10:35 +01:00
Luca Cavanna fffa6a21dc Fixed FileUtilsTests, used wrong path separator (worked only on *nix) 2013-12-18 11:05:30 +01:00
Boaz Leskes 5475ccf738 Move XContent rendering of ClusterIndexHealth to the class itself 2013-12-18 11:00:52 +01:00
Alexander Reelsen 8dce82d64d Removed exception handling in InternalIndexShard.completionStats()
This is already caught at another level, see #4203
2013-12-18 10:52:23 +01:00
Martijn van Groningen 40ec7116d8 Removed unnecessary get call 2013-12-17 22:45:05 +01:00
Boaz Leskes ae09f85c9e removed a left over debug log 2013-12-17 16:29:02 +01:00
Boaz Leskes 33bb2ecfa8 Added a time stamp to the cluster stats response
Making it consistent with NodeStats
2013-12-17 16:06:52 +01:00
Luca Cavanna d97a00d4a7 added REST test suites runner
The REST layer can now be tested through tests that are shared between all the elasticsearch official clients.
The tests are based on REST specification that can be found on the elasticsearch-rest-api-spec project and consist of YAML files that describe the operations to be executed and the obtained results that need to be tested.

REST tests can be executed through the ElasticsearchRestTests class, which relies on the rest-spec git submodule that contains the rest spec and tests pulled from the elasticsearch-rest-spec-api project. The rest-spec submodule gets automatically initialized and updated through maven (generate-test-resources phase).

The REST runner and the needed classes are distributed within the test artifact.

The following are the options supported by the REST tests runner:

- tests.rest[true|false|host:port]: determines whether the REST tests need to be run and if so whether to rely on an external cluster (providing host and port) or fire a test cluster (default)
- tests.rest.suite: comma separated paths of the test suites to be run (by default loaded from /rest-spec/test classpath). it is possible to run only a subset of the tests providing a sub-folder or even a single yaml file (the default /rest-spec/test prefix is optional when files are loaded from classpath) e.g. -Dtests.rest.suite=index,get,create/10_with_id
- tests.rest.spec: REST spec path (default /rest-spec/api from classpath)
- tests.iters: runs multiple iterations
- tests.seed: seed to base the random behaviours on
- tests.appendseed[true|false]: enables adding the seed to each test section's description (default false)
- tests.cluster_seed: seed used to create the test cluster (if enabled)

Closes #4469
2013-12-17 15:36:16 +01:00
Shay Banon 3fed65e486 reuse shard identifier if possible 2013-12-17 15:35:01 +01:00
Alexander Reelsen 59cedea010 Fix parsing of file based template loading
We support three different settings in templates

* "settings" : { "index" : { "number_of_shards" : 12 } }
* "settings" : { "index.number_of_shards" : 12 }
* "settings" : { "number_of_shards" : 12 }

The latter one was not supported by the fix in #4235

This commit fixes this issue and uses randomized testing to test any of the three cases above when running integration tests.

Closes #4411
2013-12-17 14:34:56 +01:00
Shay Banon be860c8004 take into account field mapped analyzers in simple_query_string
need to use the correct analyzer here, that will automatically choose the correct analyzer per field
2013-12-17 14:34:20 +01:00
Simon Willnauer a4f97bed9d Randomize AllocationDecider order in tests 2013-12-17 13:55:43 +01:00
Simon Willnauer 79ab05cdcf Improve allocation of unassigned shards with early termination
When we allocate unassigned shards we can terminate early for some
shards like if we already tried to allocate a replica we don't need
to try the same replica if the first one got rejected. We also
can check if certain nodes can't allocate any primaries or shrads
at all and take those nodes out of the picture for the current round
since it will not change in the current round.
2013-12-17 13:55:43 +01:00
Boaz Leskes 2b6214cff7 Added Cluster Stats API
Closes #4460
2013-12-17 13:14:46 +01:00
Simon Willnauer 75b6415b1a Fail test with timeout and stack dump after 20 min rather than 1h 2013-12-17 12:26:14 +01:00
Boaz Leskes 9fb361cea1 Move index health calculations to ClusterIndexHealth so it can be reused. 2013-12-17 11:31:22 +01:00
Adrien Grand 33599d9a34 Compressed geo-point field data.
This commit allows to trade precision for memory when storing geo points.
This new field data impl accepts a `precision` parameter that controls the
maximum expected error for storing coordinates. This option can be updated on
a live index with the PUT mapping API.

Default precision is 1cm, which requires 8 bytes per geo-point (50% memory
saving compared to using 2 doubles).

Close #4386
2013-12-17 11:29:48 +01:00
Shay Banon a1ee68a145 fix usage of deprecated netty header method 2013-12-17 10:59:27 +01:00
Alexander Reelsen c30945a3d8 Start elasticsearch in the foreground by default
Instead of using the '-f' parameter to start elasticsearch in the
foreground, this is now the default modus.

In order to start elasticsearch in the background, the '-d' parameter
can be used.

Closes #4392
2013-12-17 10:39:22 +01:00
Shay Banon 809e870b8d introduce a native int/long open immutable map, and use it in in routing table 2013-12-16 20:33:38 +01:00
Simon Willnauer 1dc8c079da Wait until index is in the clusterstate after restart 2013-12-16 19:52:00 +01:00
Martijn van Groningen 23d2b1ea7b Renamed top level `filter` to `post_filter`.
Closes #4119
2013-12-16 17:10:14 +01:00
Lee Hinman db431b7cb3 Remove the `field` and `text` queries.
The `text` query was replaced by the `match` query and has been
deprecated for quite a while.

The `field` query should be replaced by a `query_string` query with
the `default_field` specified.

Fixes #4033
2013-12-16 08:59:36 -07:00
Simon Willnauer 3e321972cc Throw IAE if suggest results return differently sized results.
If the term suggester is used the results are merged depending on
the number of terms produced by the tokenizer / tokenfilter. If a
term suggester is executed across multiple indices that share the
same field but with different analysis chains we can't merge the
result anymore sicne tokens are our of order or have a different size.

This commit throws ESIllegalArgumentException if the number of entries
are not the same across all results.

Closes #3196
2013-12-16 15:31:44 +01:00
Shay Banon 2f2b95a6b8 better cluster reroute allocation benchmark 2013-12-16 15:29:50 +01:00
Luca Cavanna 173a91bb46 Added new IndicesLifecycle.Listener method that allows to listen for any IndexShardState internal change.
Closes #4413
2013-12-16 15:00:15 +01:00
Adrien Grand 4e7ce4ee02 Make field data changes immediately taken into account and add the ability to disallow field data loading.
This commit changes field data configuration updates so that they are
immediately taken into account for loading new segments. The way it works
is that field data configuration is now cached separately from the field
data cache, meaning that it is now possible to clear the field data
configuration from IndexFieldDataService while the cache will stay around. On
the next time that Elasticsearch will reload field data configuration, it will
check if there is already a cache entry, and reuse it if it exists.

To disable field data loading, all that is required is to change the field
data format to "none" (supported by all field data types) using the update
mapping API. Elasticsearch will then refuse to load field data on any new
segment, but field data which has been loaded on the previous segments will
remain available. So you need to clear the field data cache in order to
reclaim memory (otherwise memory will be reclaimed slower, as segments get
merged).

Close #4430
Close #4431
2013-12-16 14:34:33 +01:00
Simon Willnauer 8d321530de Reset source shards to `started` if canceling relocation.
Currently we miss to reset the source shards status to ACTIVE if we cancel
a relocation. If the shard is RELOCATING we need to reset to state ACTIVE.

Closes #4457
2013-12-16 11:52:16 +01:00
Simon Willnauer 30c6f2fa23 Improve RoutingNodes API
Currently the RoutingNodes API allows modification of it's internal state outside of the class.
This commit improves the APIs of `RoutingNode` and `RoutingNode` to change internal state
only within the classes itself.

Closes #4458
2013-12-16 11:50:45 +01:00
Sebastian Geidies 6af80d5017 Optimizes performance of AllocationDecider execution. Instead of using loops over all ShardRoutings, do accounting in RoutingNodes.
Speeds up recalculating cluster state on large clusters.
2013-12-16 11:35:45 +01:00
Alexander Reelsen 6a856c86e8 Cat API: Add endpoint to show aliases
This endpoint allows to check aliases, their indices, if a filter is
configured along with routing values for searching and indexing.

Closes #4414
2013-12-16 10:37:06 +01:00
Boaz Leskes 33e49a55f7 Increased timeout in ClusterServiceTests.testTimeoutUpdateTask to 100ms
The previous 2ms timeout was too small and caused a racing condition in timeout handling. This will be fixed but requires more work.
2013-12-16 10:02:24 +01:00
Simon Willnauer a668cd22d8 wait until cluster-state is ready after startup 2013-12-15 22:26:11 +01:00
Simon Willnauer d9e988aea9 Fix QuorumLocalGatewayTests#testChangeInitialShardsRecovery to start only one shard to not fulfill the quorum 2013-12-15 20:06:22 +01:00
Igor Motov d8ba92cfa8 Resolve potential deadlock state during EsThreadPoolExecutor shutdown
Fixes #4334

The deadlock occurs between monitor object of EsThreadPoolExecutor and mainLock of ThreadPoolExecutor. The shutdown method of EsThreadPoolExecutor obtains the lock on monitor first and waits for mainLock of ThreadPoolExecutor in ThreadPoolExecutor#shutdown for part of the processing, while EsThreadPoolExecutor#terminated is executed under mainLock and tries to obtain monitor to notify listeners.
2013-12-14 21:45:03 -05:00
Shay Banon 80ab75e54e upgrade to latest jsr166 2013-12-14 01:27:18 +01:00
Luca Cavanna 9b121baafc More common AcknowledgedRestResponseActionListener
Introduced use of AcknowledgedRestResponseActionListener in put/delete index template
2013-12-13 19:39:46 +01:00
Simon Willnauer d684a2b8da Don't try to run check-index in MockDirectoryWrapper
if the MockDirWrapper checks the index on close it closes all
closeables that is has to crash the index if something is not flushed yet.
For us this is a problem since the input is still used. We need to fix this in
lucene first.
2013-12-13 17:44:10 +01:00
Adrien Grand 19c8d18b14 Relax a bit the accuracy tests on SloppyMaths.
Tests now ensure that the computed distance is correct within 1‰ instead of 1‱.
2013-12-13 15:42:39 +01:00
Adrien Grand 36bd9cc432 Aggregations: Ordinals-based string bucketing support.
When the ValuesSource has ordinals, terms ordinals are used as a cache key to
bucket ordinals. This can make terms aggregations on String terms significantly
faster.

Close #4350
2013-12-13 15:34:02 +01:00
Martijn van Groningen cc61348013 Fixed test bug 2013-12-13 14:54:21 +01:00
Martijn van Groningen 10e2528cce Added the `force_source` option to highlighting that enforces to use of the _source even if there are stored fields.
The percolator uses this option to deal with the fact that the MemoryIndex doesn't support stored fields,
this is possible b/c the _source of the document being percolated is always present.

Closes #4348
2013-12-13 13:39:53 +01:00
Simon Willnauer 59e4e58683 Add trace logging to AllocationDeciders if decision is NO() 2013-12-13 12:08:26 +01:00
Sebastian Geidies 6ed126deaf Skipping execution of remaining Deciders if one of them returns a Decision.NO.
Reordering execution of the different AllocationDeciders, so the cheapest get executed first.
2013-12-13 11:52:48 +01:00
Boaz Leskes 2acccf257d Add `queries` to XContent output of PercolateStats
The queries stats tracked but not exposed to the Rest API

Closes #4440
2013-12-13 11:36:51 +01:00
Boaz Leskes b65d07b495 A failure during the response construction could cause a Node Operation never to return 2013-12-13 10:36:39 +01:00
Shay Banon 976bdd6a26 randomize transport tcp compression on nodes 2013-12-12 23:19:59 +01:00
Shay Banon 0469cca4be properly support global transport compression with new bytes transport request optimization 2013-12-12 22:29:54 +01:00
Shay Banon 0f4d81fcd4 refresh the mapping source directly into a compressed buffer
instead of building the mapping source, and then compressing it, we can generate it directly into a compressed buffer
2013-12-12 20:58:11 +01:00
Lee Hinman 77fcf71338 Add new `simple_query_string` query type
This adds support for Lucene's SimpleQueryParser by adding a new type
of query called the `simple_query_string`. The `simple_query_string`
query is designed to be able to parse human-entered queries without
throwing any exceptions.

Resolves #4159
2013-12-12 12:09:32 -07:00
Alexander Reelsen 348c3731c8 Fixing debian init script to work on ubuntu LTS
sysctl parameters must be separated like `-q -w` instead of `-qw`
2013-12-12 17:57:34 +01:00
Adrien Grand e2e19203d7 Remove IndexFieldData.getHighestNumberOfSeenUniqueValues().
Closes #4426
2013-12-12 15:44:05 +01:00
Shay Banon f0e1f9215b try and wait better for all mapping updates to be processes in test 2013-12-12 15:06:37 +01:00
Simon Willnauer 198d36dc15 Also wrap IndexInput if CFS is used 2013-12-12 12:14:47 +01:00
Simon Willnauer d95420cc67 Add more information to IndexInput failures related to abusing closed input 2013-12-12 10:44:01 +01:00
Adrien Grand 0554f8e875 Add missing mappers to MapperBuilders.
- completion
 - geo_point
 - geo_shape
 - parent
 - size
 - ttl

Close #4423
2013-12-12 09:44:55 +01:00
Martijn van Groningen b4d1d899d2 Replaced the synchronization method for enabling the realtime percolator from synchronized methods to use AtomicBoolean#compareAndSet instead.
Remove @TestLogging from percolator tests.
2013-12-11 22:54:35 +01:00
Luca Cavanna 2cbecd9cb3 Made sure that we never throw IndexMissingException in indices query and filter
It could happen although we internally use IgnoreIndices.MISSING, due to MetaData#concreteIndices contract, which throws IndexMissingException anyway if all requested indices are missing.
In case all the indices specified in the query/filter are missing, we just execute the no_match query/filter, no need to throw any error.

Closes #3428
2013-12-11 22:26:46 +01:00
Luca Cavanna 24434063b6 Introduced ok & acknowledged constant in AcknowledgedRestResponseActionListener 2013-12-11 21:28:54 +01:00
Luca Cavanna b1fa147968 More common AcknowledgedRestResponseActionListener
Introduced use of AcknowledgedRestResponseActionListener in put/delete alias & delete index
2013-12-11 21:28:15 +01:00
Luca Cavanna 037bf6a85f Unified default ack timeout to 30 seconds
Increased also default publish state timeout to 30 seconds (from 5 seconds) and introduced constant for it.
Introduced AcknowledgedRequest.DEFAULT_ACK_TIMEOUT constant.
Removed misleading default values coming from the REST layer.
Removed (in a bw compatible manner) the timeout support in put/delete index template as the timeout parameter was ignored.

Closes #4395
2013-12-11 20:54:27 +01:00
Martijn van Groningen f9ff733eb8 Renamed the methods in DocumentListenerType to actually reflect when these are invoked. 2013-12-11 17:51:09 +01:00
Martijn van Groningen 92c32dca9e Invoke the DocumentType listeners *before* the mappers are updated. This fixes an issue where if two or more concurrent percolate index requests are processed, the first request would the `.percolator` type mapping, but the real time percolator listener wouldn't be active, this would result in that the subsequent concurrent requests wouldn't be parsed and kept in memory and would never be included in any percolate api result. This issue any occurred when `.percolator` type is created on the fly.
Also made the call to PercolatorQueriesRegistry#enableRealTimePercolator and #disableRealTimePercolator synchronized, so that for the same shard the RealTimePercolatorOperationListener can't registered twice.
2013-12-11 17:41:10 +01:00
Shay Banon a3f1c428c2 bulk response has errors indication + status per item
closes #4002
2013-12-11 16:04:41 +01:00
Shay Banon 10cdb0ae22 Batch processing mapping updates can cause missed merged mappings when batching multiple types
when we bulk changes, we need to use the same index metadata builder across the tasks, otherwise we might remove mappings erroneously
 also, when we check if we can use a higher order mapping, we need to verify that its for the same mapping type
2013-12-11 14:34:59 +01:00
Martijn van Groningen a760f1f54a Make listeners a final field in ShardIndexingService, which fixed possible visibility issue. 2013-12-11 12:22:45 +01:00
Shay Banon aee388ec46 introduce an internal metadata uuid 2013-12-11 10:49:36 +01:00
Florian Schilling 937a4e9d9d SloppyMath
Added copy of SloppyMath.java from lucene 4.6+
and setup GeoDistance for new haversin method

closes #3862
2013-12-11 17:51:32 +09:00
Alexander Reelsen 81e13a870b Packaging: Ensure setting of sysctl vm.max_map_count
In order to be sure that memory mapped lucene directories are working
one can configure the kernel about how many memory mapped areas
a process may have. This setting ensure for the debian and redhat initscripts
as well as the systemd startup, that this setting is set high enough.

Closes #4397
2013-12-11 09:19:22 +01:00
Boaz Leskes 99b421925f Add wildcard support to field resolving in the Get Field Mapping API
Closes #4367
2013-12-10 23:46:37 +01:00
Shay Banon a9e259d438 Introduce BytesTransportRequest, allowing for downstream network optimization in buffers usage
When sending a request, mainly to multiple nodes, if we already have the "body" of the request in bytes, we can share it instead of copying it over to a new buffer. Also, it helps a lot when sending a relatively large body to multiple nodes, since it will use the same body buffer across all nodes
2013-12-10 22:49:31 +01:00
Alexander Reelsen c4f3da2b9d Preference only_node with unknown nodeId returns useful exception
When the search preference is set to only node, but this node is not a
data (or does not exist), we return a search exception, which indicates,
that this is actually a server problem.

However specifying a non-existing node id is a client problem
and should return a more useful error message than
{"error":"SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed]","status":503}
2013-12-10 20:15:14 +01:00
Martijn van Groningen 7d3b78c293 moved log statements 2013-12-10 19:54:27 +01:00
Richard Boulton 1037d071bf Fix bug in explain for function_score queries.
The explain output for function_score queries with score_mode=max or
score_mode=min was incorrect, returning instead the value of the last
function.  This change fixes this.
2013-12-10 17:59:00 +01:00
Simon Willnauer 6c189310b9 Remove 'term_index_interval' and 'term_index_divisor'
These settings are no longer relevant since they are codec /
postingsformat level settings since Lucene 4.0

Closes #3912
2013-12-10 16:54:08 +01:00
Martijn van Groningen 38cff53a0f Added more logging for percolator.
Lowered log level in percolator tests.
2013-12-10 15:45:04 +01:00
Adrien Grand 794a927c43 Use a dedicated cluster name for GeoDistanceSearchBenchmark (like we do for other benchmarks). 2013-12-10 14:42:14 +01:00
Luca Cavanna ac158f6a87 Made sure the new cluster state is not held by AckCountDownListener
(also made AckCountDownListener class static)
2013-12-10 11:15:46 +01:00
Simon Willnauer acf371ef57 Do not override thetas if sum is less or equals to `0`
Closes #4390
2013-12-10 10:41:50 +01:00
Simon Willnauer 2dfb1d98f4 move to ensureGreen in aggs tests to stabelize tests 2013-12-09 21:50:24 +01:00
Simon Willnauer 5771f9083c Added ElasticsearchIntegrationTest#ensureSearchable() to prepare indices to be searchable
Currently we sometimes see test failures that fail because not all replicase are
`searchable` which means they are not started yet or still recovering. Yet, the usual
situation is where two nodes have the same clusterstate but the one that acts as
the search target has not yet processed that clusterstate. The requester sees the
shard as started but it's not mark as such on the target node. For now the #ensureSearchable()
just delegates to #ensureYellow() to make sure the cluster is not red. In the future if we have
the possibilty to recover from situations like this in the search logic we can easily test
this by making the impl a no-op. Note: this problem only occurs if you have low number of docs
and the indexing is really quick such that first request are exectued but shards are not
fully `started`
2013-12-09 17:31:58 +01:00
Martijn van Groningen d3fde78394 Fix test failure. 2013-12-09 17:27:58 +01:00
Martijn van Groningen 1b481ef395 Support postings highlighter in percolate api.
The postings hl now uses a searcher that only encapsulate the view of segment the document being highlighted is in,
this should be better than using the top level engine searcher.

Closes #4385
2013-12-09 16:56:09 +01:00
Alexander Reelsen d2ee22f01c Allow to get a specific transport client inside of tests
Adding functionality to call cluster().transportClient() in tests in order
to get an arbitrary TransportClient object back, independently if the
transport client ratio in returning the normal clients is configured.

Also made sure, that if the normal client is already a transport client
(or a node client) we do not generate another one.
2013-12-09 14:39:22 +01:00
Simon Willnauer 7cd189b3d3 Trace log all shard failures if an exception is attached. 2013-12-09 11:55:13 +01:00
Simon Willnauer 44382ae629 remove ensureGreen for debugging 2013-12-09 11:04:33 +01:00
Simon Willnauer 7ff4681e5f Enable Trace Logging for org.elasticsearch.action.search.type on aggregations 2013-12-09 11:03:36 +01:00
Simon Willnauer 581eb618b3 Add Class and Package Level support for TestLogging 2013-12-09 11:02:13 +01:00
David Pilato 9d8361a542 Use random number of iteration for tests
Thanks @simonw for the review.
Related to #4361 and #4371.
2013-12-09 09:01:51 +01:00
David Pilato a2853f3855 Use random number of iteration for tests
Thanks @simonw for the review.
Related to #4361 and #4371.
2013-12-09 08:41:45 +01:00
Lee Hinman bc9698a347 Support 'yaml' as a format for the Analyze API
Fixes #4311
2013-12-08 15:08:00 -07:00
Simon Willnauer 2058a03547 Enable Trace Logging for SearchWhileRelocatingTests 2013-12-08 22:31:17 +01:00
Simon Willnauer 7e326bdb73 Beef up test to use more threads and iterations randomly 2013-12-08 20:56:24 +01:00
Simon Willnauer 191887dd08 Added refCount assertion due to LUCENE-5362 2013-12-08 20:55:57 +01:00
Simon Willnauer 11e2b1bef3 Move Thread.sleep test to awaitBusy 2013-12-08 20:55:08 +01:00
Simon Willnauer 1ef349db49 Add generic assertion to all aggs.bucket tests to check if all shards were successful 2013-12-08 19:34:17 +01:00
Shay Banon 36a76cc0ab add node and order to the source of update mapping 2013-12-08 03:32:10 +01:00
uboness 2e08977adc - fixing update mapping tests for index operations so the number of request will be based on the index thread pool size
- added update mapping tests for bulk operations
2013-12-07 22:57:18 +01:00
David Pilato 822acfa568 Query String caching could cause matched_filters not working
When searching with a query containing query_strings inside a bool query, the specified _name is randomly missing from the results due to caching.

Closes #4361.
Closes #4371.
2013-12-07 22:52:16 +01:00
Boaz Leskes b7d6cce4c9 Add an `usage` key to the CPU section of OsStats.toXContent.
This is just the sum of existing `sys` and `user`

Closes #4374
2013-12-07 21:26:22 +01:00
Shay Banon 104613c0b9 update the test to use the same API as 0.90
so backports will be simpler for now
2013-12-07 19:31:33 +01:00
Shay Banon 4a3978d1b7 Optimize dynamic mapping updates on master by processing latest one per index/node
Instead of processing all the bulk of update mappings we have per index/node, we can only update the last ordered one out of those (cause they are incremented on the node/index level). This will improve the processing time of an index that have large updates of mappings.
closes #4373
2013-12-07 19:20:16 +01:00
Simon Willnauer dd95895977 Apply slop correctly if phrase query is wrapped in a filtered query.
If a phrase query is wrapped in a filtered query due to type filtering
slop was not applied correctly. Also if the default field required a
type filter the filter was not applied.

Closes #4356
2013-12-06 23:02:09 +01:00
Adrien Grand 309ee7d581 Fix _all boosting.
_all boosting used to rely on the fact that the TokenStream doesn't eagerly
consume the input java.io.Reader. This fixes the issue by using binary search
in order to find the right boost given a token's start offset.

Close #4315
2013-12-05 18:40:25 +01:00
Andrew Raines 53be1fe9d0 Cat: Add descs for rest of actions. 2013-12-05 10:44:26 -06:00
Andrew Raines aec2b95401 Cat: Add nodes column descriptions. 2013-12-05 08:44:00 -06:00
Shay Banon 28eff2ba29 remove help command, list all cat commands in /_cat?h endpoint 2013-12-05 14:36:27 +01:00
Boaz Leskes 0e78404af3 Added a FsStats.total section that sums up all stats for the different path.dirs. Added `disk_io_size` and `disk_io_op` to the toXContent output, summing up `disk_read_size+disk_write_size` and `disk_writes+disk_reads` respectively.
Closes #4344 , Closes #4343
2013-12-05 12:18:22 +01:00
Martijn van Groningen 9f57dc1de3 test fix 2013-12-05 03:17:56 +01:00
Martijn van Groningen facd18086c test fix 2013-12-05 02:21:18 +01:00
Shay Banon e04474bcd8 Allow to disable sending a refresh-mapping to master node
When a node processed an index request, which caused it to update its own mapping, then it sends that mapping to the master. While the master process it, that node receives a state that includes an older version of the mapping. Now, there is a conflict, its not bad (i.e. the cluster state will eventually have the correct mapping), but we send for a refresh just in case form that node to the master.

With a system that has extreme cases of updates and frequent mapping changes, it might make sense to disable this feature. The indices.cluster.send_refresh_mapping setting can be introduced to support that (note, this setting need to be set on the data nodes)

Note, sending refresh mapping is more important when the reverse happens, and for some reason, the mapping in the master is ahead, or in conflict, with the actual parsing of it in the actual node the index exists on. In this case, the refresh mapping will result in warning being logged on the master node.

closes #4342
2013-12-05 01:18:39 +01:00
Shay Banon df4ffbe723 better error handling when processing refresh/update mapping
don't fail the whole bulk of updates, just the specific ones, and warn log it
2013-12-05 00:58:35 +01:00
Martijn van Groningen dd86db3347 Fixed incorrect results with `has_child` query with score mode if the parent type has nested object types. The inner objects (Separate Lucene docs) are also emitted as hits, which incorrectly decreased the count down short circuit mechanism in the `has_child` query.
Closes #4341
2013-12-05 00:57:10 +01:00
Simon Willnauer 2b42a0f94a Override DefaultExceptionHandler to filter out certain exceptions
We have the situation that some tests fail since they don't handle
EsRejectedExecutionException which gets thrown when a node shuts
down. That is ok to ignore this exception and not fail.
We also suffer from OOMs that can't create native threads but don't
get threaddumps for those failures. This patch prints the thread
stacks once we catch a OOM which can' create native threads.
2013-12-04 14:18:52 +00:00
Shay Banon 74bfa27e7e Fail geohash_cell filter if geohash prefix is not enabled
closes #4335
2013-12-04 13:16:55 +01:00
Martijn van Groningen eacbd8f88d Fixed parsing bug in percolator, where everything after the `doc` object was skipped.
Closes #4325
2013-12-04 01:11:24 +01:00
Adrien Grand 346d8efeb5 Fix implementation of currentValueHash in FieldDataSource.Bytes.SortedAndUnique.
Close #4330
2013-12-04 00:42:24 +01:00
Andrew Raines 9e4b5ea242 Introduce abstract superclass, group cat module bindings, and short-circuit helps. 2013-12-03 18:32:12 -05:00
Shay Banon adef349f74 MetaData to use new iterator in ImmutableOpenMap 2013-12-03 22:43:25 +01:00
Shay Banon fd014473d0 expose key and value iterators in ImmutableOpenMap 2013-12-03 22:29:54 +01:00
uboness 84d7929c3b - removed the getKeyAsString method from StringTerms (redundant method) 2013-12-03 18:18:23 +01:00
Martijn van Groningen 5fb15d3afa The registered queries were loaded after shard went to started phase, this resulted in the situation that the percolate api could be used while the registered queries still needed to be loaded from disk.
The newly added afterIndexShardPostRecovery method to InternalIndicesLifecycle, that the percolator now uses to trigger the loading of the registered queries will make sure that a shard doesn't go to started state before the queries have been loaded.
The percolate api (like other apis) will retry the execution on a different shard copy if a shard isn't in a started state preventing empty results if there registered queries to be loaded. Percolator tests fail sometimes for this reason.
2013-12-03 15:10:36 +01:00
Martijn van Groningen 9d1e3a7256 Added test logging 2013-12-03 11:27:27 +01:00
Nik Everett 8e34057bc0 Add support for combining fields to the FVH
The Fast Vector Highlighter can combine matches on multiple fields to
highlight a single field using `matched_fields`.  This is most
intuitive for multifields that analyze the same string in different
ways.  Example:
{
    "query": {
        "query_string": {
            "query": "content.plain:running scissors",
            "fields": ["content"]
        }
    },
    "highlight": {
        "order": "score",
        "fields": {
            "content": {
                "matched_fields": ["content", "content.plain"],
                "type" : "fvh"
            }
        }
    }
}

Closes #3750
2013-12-03 11:10:01 +01:00
Adrien Grand df08894b53 Fix broken test. 2013-12-03 10:57:11 +01:00
Alexander Reelsen 7c96627d76 Remove bash specific calls
Make sure that every call in a shell script is supported by /bin/sh and not a bashism, like $()

Closes #4314
2013-12-03 10:23:40 +01:00
Nik Everett 7690b40ec6 Allow string fields to store token counts
To use this one you send a string to a field of type 'token_count'.  This
makes the most sense with a multi-field.
2013-12-03 09:39:32 +01:00
Martijn van Groningen 43691bb735 Removed shortCircuit in MatchDocIdSet since it is no longer used. 2013-12-02 18:28:27 +01:00
Simon Willnauer 2c8ee3fbbe Moving to 1.0.0RC1 snap 2013-12-02 17:10:07 +01:00
Kevin Kluge 296cfbe390 release [1.0.0.Beta2] 2013-12-02 15:45:30 +00:00
Martijn van Groningen 5488bab003 Use EA#assertMatchCount() over just checking the match count. 2013-12-02 14:50:00 +01:00
Simon Willnauer e18bee50ef User minimum_master_nodes in tests that shutdown nodes some of those time out on Windows 2013-12-02 13:04:13 +01:00
Martijn van Groningen cf63ea212f Use EA#assertMatchCount() over just checking the match count. 2013-12-02 12:12:04 +01:00
uboness 2f835621ae added more wait for green status on aggs tests 2013-12-02 11:42:51 +01:00
Martijn van Groningen a1d58bf486 fix mapping error in p/c benchmarks 2013-12-02 11:31:31 +01:00
Martijn van Groningen 809c7d07f0 only wrap the parentFilter in ApplyAcceptedDocsFilter, not the other short circuit filters. 2013-12-02 11:05:55 +01:00
uboness cdc7dfbb2c Changed the "script_lang" parameter to "lang" in all value source based aggs - to be consistent with all other script based APIs. 2013-12-02 02:01:03 +01:00
Martijn van Groningen 079ac79617 Added random filtered query logic the to random parent query tests.
Fixed bug in ParentQuery.ChildScorer#advance(), the parent value was checked for the _uid field while the _parent should have been checked.
2013-12-02 00:18:59 +01:00
Martijn van Groningen 292e53fe77 The short circuit mechanism always needs to be wrapped with the live docs. In certain scenarios the live docs isn't passed down with acceptedDocs.
For example when a has_child is wrapped in a filtered query as query and the wrapped filter is cached.
The short circuit mechanism in that case counts down based on deleted docs, which then yields lower results than is expected.

Relates to #4306
2013-12-02 00:18:59 +01:00
Simon Willnauer 27f9f9bdb4 Log intermediate pending searchers as trace instead of debug 2013-12-01 19:44:56 +01:00
Simon Willnauer d2bd476e70 add more ensureGreen to aggs tests 2013-12-01 18:58:39 +01:00
Martijn van Groningen 04675f85cf Make the ChildrenQuery and ParentQuery not rely on the fact that score of 0 means that there isn't a match. 2013-12-01 17:22:58 +01:00
Martijn van Groningen 1285894f5f Also short circuit within segment when score mode is avg 2013-12-01 16:44:19 +01:00
Martijn van Groningen ac1e985670 Fixes related to accepted docs not taken into account:
* Removed the applyAcceptedDocs in ChildrenConstantScoreQuery, they need to be applied at all times. (because of short circuit mechanism)
* Moved ParentDocSet to FilteredDocIdSetIterator, because it fits better than MatchDocIdSet.
* Made similar changes to ParentConstantScoreQuery for consistency between the two queries. The bug accepted docs bug didn't occur in the ParentConstantScoreQuery.
* Updated random p/c tests to randomly update parent or child docs during the test run.

Closes #4306
2013-11-30 20:05:55 +01:00
Simon Willnauer 5d2c334bbd wait for green in tests for now 2013-11-30 19:41:49 +01:00
Alexander Reelsen 971b828e76 Cat API: Improve help and execute help before sending server requests
* Force the cat API classes to have simple help available by extending from a AbstractCatAction
* Use a set binder on guice creation to create the help on node start up
* Make sure that the help/field info is returned without querying any data
2013-11-30 16:22:30 +01:00
uboness 88d829ad78 added more assertions to aggs tests 2013-11-30 05:44:04 +01:00
uboness efea1298cd added assertions for shard failures in stats agg tests 2013-11-30 03:58:11 +01:00
Shay Banon ed01d53506 NullPointerException in FsTranslog when reverting transient log
This happens when reverting the trans transaction log on failure, and when that happens, actually we might have failed on the transient translog creation to being with....
fixes #4223
2013-11-30 00:30:32 +01:00
Luca Cavanna fe1d22af01 trimmed down SimpleQueryTests + more assertAcked 2013-11-29 21:15:28 +01:00
Luca Cavanna de206e72f1 Added simple test for minScore 2013-11-29 20:35:40 +01:00
Clinton Gormley bc393b6d79 Changed the minScore comparator from > to >=
Closes #4303
2013-11-29 20:29:20 +01:00
Adrien Grand 65541e6912 Fix computation of explanations for AllTermQuery.
The use of freq() instead of sloppyFreq() and the fact that `numMatches` was
not updated in `setFreqCurrentDoc` could lead to an inaccurate score in the
explanation.

Close #4298
2013-11-29 19:24:56 +01:00
Benjamin Devèze c20d4bb69e Add line feed for prettified main REST action 2013-11-29 16:42:50 +01:00
Luca Cavanna 8e54319a1d test classes cleanup (fixed warnings and typos) 2013-11-29 16:22:20 +01:00
Luca Cavanna b214943522 fixed typo in TestCluster 2013-11-29 14:55:24 +01:00
uboness 0d6a35b9a7 - Added support for term filtering based on include/exclude regex on the terms agg
- Added javadoc to the TermsBuilder

Closes #4267
2013-11-29 13:46:48 +01:00
Luca Cavanna 630641f292 Refactored put mapping api to make use of the new recently introduced generic ack mechanism
Note: we were previously waiting for ack only from all nodes that contain shards for the indices that the mapping updatewas applied to. This change introduces a wait for ack from all nodes, consitent with other api as the ack is meant more on the cluster state itself, which is held by all nodes and needs to be updated on all nodes anyway.

Closes #4228
2013-11-29 11:39:23 +01:00
Alexander Reelsen 0ec3eaf53d Completion postings format: Write hole character
Another issue found by randomized testing.
2013-11-29 10:40:33 +01:00
Andrew Raines 28ecafac11 Display placeholder for non-master-eligible nodes. 2013-11-29 02:35:45 -06:00
Andrew Raines 455c92d27b Check for load avg before attempting to display. 2013-11-29 02:32:54 -06:00
Andrew Raines 9aee9949e5 Convert _cat/count to TimestampedTable. 2013-11-29 02:19:56 -06:00
Andrew Raines d16aacb8d3 Supply field descriptions for TimestampedTable. 2013-11-29 02:19:15 -06:00
Andrew Raines 91999e14ce Add _cat/pending_tasks.
Closes #4251.
2013-11-29 01:09:06 -06:00
Andrew Raines 8f4c8e0d4a Should be limiting health request to concreteIndices.
Closes #4296.
2013-11-28 21:13:32 -06:00
imotov d2f91173b7 Increase priority of shard started task to URGENT 2013-11-28 19:20:18 -05:00
Martijn van Groningen 61aba89110 Added aggregation support to the percolate api.
Closes #4245
2013-11-28 17:26:07 +01:00
Martijn van Groningen 9fe2b8e074 Randomly use a cached filter.
Wrap the ChildrenQuery in a XFilteredQuery to also execute other code paths (scorer#advance)
2013-11-28 17:22:51 +01:00
Martijn van Groningen 2ca5fd64fe Fixed positive infinity bug that can occur in specific scenarios when score mode average is used.
Closes #4291
2013-11-28 17:21:29 +01:00
Simon Willnauer 06f520ebeb Use FilterDirectory from lucene instead of maintaining a copy
FilterDirectory has been ported to Lucene in LUCENE-5204 which makes
the class in elasticsearch obsolet. This commit removes the class and
moves the static utils that are not in lucene to `DirectoryUtils`
2013-11-28 14:37:48 +01:00
Alexander Reelsen 11de330246 Made hole character in XAnalyzingSuggester part of Postingsformat
* Hole charactor now can change with new releases
* Fixed bug where the SEP_LABEL constant was used instead of the sepLabel instance variable
* Replaced if- with switch-statement
2013-11-28 14:22:10 +01:00
Adrien Grand 1e85e4dd26 Add more logging to recent aggregations failures. 2013-11-28 13:22:39 +01:00
Adrien Grand 5968680b41 Fix test bug: we need at least one parent to have 1 child or more. 2013-11-28 09:40:52 +01:00
Simon Willnauer 71eb4532f8 Catch AlreadClosedException in RobinSearcher#release()
When we relocate a shard we might still have pending SearchContext
instances hanging around that will be used in "in-flight" searches
on the already relocated shard. This is a valid operation but if
we have already closed the underlying directory which happens during
cleanup concurrently the close call on the IndexReader can trigger
an AlreadyClosedException when the NRT reader tries to cleanup files
via the IndexWriter.

Closes #4273
2013-11-27 15:55:30 +01:00
Simon Willnauer ba3269dedc Fix assertions in testEquivalence and beef up the test 2013-11-27 15:21:09 +01:00
Adrien Grand 596d511466 Cleanup of IndexFieldDataService.getForField.
This method has 2 signatures and one of them is dangerous since it allows to
discard fielddata configuration of the field mapper. This commit changes the
percolator so that it uses fielddata configuration of the _id field mapper
instead of forcing the paged_bytes format.

Closes #4270
2013-11-27 14:56:09 +01:00
uboness fda6ca4869 Added support for shard_size in terms agg
Closes #4242
2013-11-27 14:16:58 +01:00
Simon Willnauer d18ce2733d Cleanup Rescorer Tests & add random indexing 2013-11-27 11:55:29 +01:00
Alexander Reelsen 4774439436 Fixed file-based template loading via config/templates
When parsing the json file, the first field is ignored as
parser.nextToken() seems to be called too often.

Closes #4235
2013-11-27 09:49:15 +01:00
Simon Willnauer e66c2793aa Add hole character to the reverved characters for completion suggester 2013-11-26 22:46:43 +01:00
Shay Banon f40959cc30 Cat API: Add h parameter to apis, allowing to return columns and descriptions for them
closes #4262
2013-11-26 22:14:18 +01:00
Alexander Reelsen 2a456e5716 Fixing CompletionFieldMapper.isReservedChar() to take all relevant chars in account 2013-11-26 20:42:37 +01:00
Martijn van Groningen 3c4fc119ab Only print the warning about '.' in type, when it is not a percolator type. 2013-11-26 19:01:43 +01:00
Martijn van Groningen dafb90e62a Include facets in the rest response. 2013-11-26 18:59:21 +01:00
Britta Weber 1510cd6923 Fix issue 3989
Multi term vector request never returned if shards for all requested documents
were non existent.

closes #3989
2013-11-26 17:04:18 +01:00
Britta Weber 3be5f3345e Make parsing of uri and body parameters consistent with single term vector api
uri parameters were not all parsed for the multi term vector request. This commit
makes sure that all parameters are parsed and used when creating the requests for the
multi term vector request.

In order to simplify both code and json request, the request structure now allows
two ways to use multi term vectors:

1. Give all parameters for each document requested in the docs array like this:

```
{
   "docs": [
      {
         "_index": "testidx",
         "_type": "test",
         "_id": "2",
         "terms": [
            "fox"
         ],
         "term_statistics": true
      },
      {
         "_index": "testidx",
         "_type": "test",
         "_id": "1",
         "terms": [
            "quick",
            "brown"
         ],
         "term_statistics": false
      }
   ]
}
```

2. Define a list of ids and give parameters in a separate parameters object like this:

```
{
   "ids": [
      "1",
      "2"
   ],
   "parameters": {
      "_index": "testidx",
      "_type": "test",
      "terms": [
         "brown"
      ]
   }
}
```

uri parameters are global parameters that are set for both cases. They are overwritten
by parameter definitions in the body.

Also, this commit adds the missing setParent(..) and setPreference(..) to TermVectorRequestBuilder.
2013-11-26 17:02:56 +01:00
Alexander Reelsen 6e1a04b370 Added unit test for current completion postingsformat 2013-11-26 12:52:07 +01:00
Alexander Reelsen 4e836a3459 Randomized CompletionSuggestSearchTests 2013-11-26 12:52:07 +01:00
Alexander Reelsen bf74f49fdd Updated Analyzing/Fuzzysuggester from lucene trunk
* Minor alignments (like setter to ctor)
* FuzzySuggester has a unicode aware flag, which is not exposed in the fuzzy completion request parameters
* Made XAnalyzingSuggester flags (PAYLOAD_SEP, END_BYTE, SEP_LABEL) to be written into the postings format, so we can retain backwards compatibility
* The above change also implies, that these flags can be set per instantiated XAnalyzingSuggester
* CompletionPostingsFormatTest now uses a randomProvider for writing data to check for bwc
2013-11-26 12:52:06 +01:00
Martijn van Groningen 9f5d01ca4c Cut DiscoveryNodes over to ImmutableOpenMap. 2013-11-26 11:57:15 +01:00
Simon Willnauer cf3ba7c51c Only use -Dtests.jvm.argline instead of numbered options 2013-11-26 11:11:19 +01:00
Simon Willnauer 9b839ca79f Add more reporting to asserting index searcher 2013-11-26 10:54:37 +01:00
Shay Banon 6f90a3e39a allow to parse directly the compressed mapping 2013-11-26 09:48:33 +01:00
Shay Banon 0610fc3ad2 use the proper abstraction of ImmutableOpenMap
we already use the open map / clone trick, might as well use the ImmutableOpenMap here
2013-11-26 02:48:31 +01:00
Martijn van Groningen a03556daa0 Added execution option to `range` filter, with the `index` and `fielddata` as values.
Deprecated `numeric_range` filter in favor for the `range` filter with `fielddata` as execution.

Closes #4034
2013-11-25 23:43:40 +01:00
Martijn van Groningen ac03fba9d3 Small cleanup 2013-11-25 23:18:36 +01:00
Martijn van Groningen 036febe110 Cut the following classes over to ImmutableOpenMap:
* MetaData
* IndexMetaData
* ClusterState
* IndexTemplateMetaData
2013-11-25 21:59:06 +01:00
Simon Willnauer 46ab6a1533 Include JVM Arg line in reproduce line 2013-11-25 14:35:34 +01:00
Shay Banon 32d073bbf8 Bulk should support shard timeout like the index api
closes #4220
2013-11-25 11:48:22 +01:00
Shay Banon 2ba7c1d4a1 acquireSearcher should fail with state failure when not set/closed
also fixes #4232
2013-11-25 11:24:55 +01:00
Shay Banon 9648a53fd5 acquireSearcher should fail with state failure when not set/closed
also fixes #4232
2013-11-25 11:24:19 +01:00
Martijn van Groningen efba3a50dd iterator doesn't implement #remove() 2013-11-25 10:32:35 +01:00
Igor Motov e3d4d73242 Local primaries should be preferred to relocating primaries
To reproduce the bug use -Dtests.seed=5AB62524C9AB0489
Fixes #4237
2013-11-24 21:20:01 -05:00
Simon Willnauer 8e17d636ef Upgrade to Lucene 4.6
This commit upgrades to Lucene 4.6 and contains the following improvements:

 * Remove XIndexWriter in favor of the fixed IndexWriter
 * Removes patched XLuceneConstantScoreQuery
 * Now uses Lucene passage formatters contributed from Elasticsearch in PostingsHighlighter
 * Upgrades to Lucene46 Codec from Lucene45 Codec
 * Fixes problem in CommonTermsQueryParser where close was never called.

Closes #4241
2013-11-24 21:08:38 +01:00
uboness 28adbd475d added a waitForGreen condition for the unmapped tests on missing agg 2013-11-24 20:26:12 +01:00
Martijn van Groningen 8fda8aaabf force default codec
reduce p/c searches and num child docs being generated
2013-11-24 15:35:11 +01:00
uboness c7f6c5266d initial commit of the aggregations module
Closes #3300
2013-11-24 03:13:08 -08:00
Simon Willnauer 34d567a133 Don't use mock wrapper on relocate stress test for now since it could be the reason for intermediate/occational failures 2013-11-23 09:22:16 +01:00
Alexander Reelsen fdc4f72e8a Added mlockall setting to process info output 2013-11-23 07:40:59 +01:00
Martijn van Groningen 688a6bd29b Added random test for ParentQuery and ChildrenQuery. 2013-11-22 18:38:46 +01:00
Martijn van Groningen c46fe4a0e8 Introduced EA#assertMatchCount() and make test used that. 2013-11-22 13:47:02 +01:00
Boaz Leskes 5e58c1b9e1 Added a bulk indexing while initializing test.
Relates to #4214
2013-11-22 13:23:42 +01:00
Igor Motov 4ffd8a663c Fix possible NPE in snapshot service if a shard doesn't have primary 2013-11-21 20:08:57 -05:00
Igor Motov 1d0bae0f50 Prevent modification or deletion of repositories while snapshots are running 2013-11-21 20:08:57 -05:00
Igor Motov 2f66bf0720 Fix typo in MockRamDirectoryService name 2013-11-21 20:08:57 -05:00
Luca Cavanna 22852d8040 AckTests: more assertAcked and added common method to retrieve local cluster state 2013-11-21 22:59:48 +01:00
Martijn van Groningen efbe1e84b9 Added random test for ParentConstantScoreQuery 2013-11-21 19:19:04 +01:00
Martijn van Groningen c5aee7200f removed the static field in ChildrenConstantScoreQueryTests 2013-11-21 18:29:41 +01:00
Martijn van Groningen 3f02392376 unset static field after test suite has been completed. 2013-11-21 16:01:03 +01:00
Martijn van Groningen 9e25c6a4db Added random test for ChildrenConstantScoreQuery. 2013-11-21 14:24:53 +01:00
Simon Willnauer 8d1e526616 By default don't fail on close sicne pending open files are common in ES
We have pending open files on a regular basis since we search while
relocating etc. and keep search contexts around that are cleaned up
later. We should rather let the close call pass on even if files are
open and only force failures on teardown in ElasticsearchIntegrationTest
2013-11-21 11:51:54 +01:00
Shay Banon f465a6b589 field level field data cache should take into account a null listener
also, cleanup the onRemoval code
2013-11-20 09:31:19 -08:00
Martijn van Groningen 1608ccc373 Use #assertAcked() for verification. 2013-11-20 12:56:08 +01:00
Alexander Reelsen 8257370415 Refactoring IndicesAnalysisService
Using enums where possible in order to clean up the code in IndicesAnalysisService

Also introduced a simpler generic caching mechanism, and tests.
2013-11-20 12:11:07 +01:00
Luca Cavanna adb83182a5 Added readTimeout, writeTimeout, readAcknowledged and writeAcknowledged methods variation without version as parameter, to be used by api that always read and write those parameters. Helps avoiding to call the variation that accepts a Version with actual version null. 2013-11-20 10:40:25 +01:00
Luca Cavanna ec3d858cc2 Added base ClusterStateUpdateRequest class that executes on multiple indices 2013-11-20 10:40:25 +01:00
Luca Cavanna 39c606c59a Refactored open/close index api to make use of the new recently introduced generic ack mechanism
Closes #4169
2013-11-20 10:40:25 +01:00
Luca Cavanna 8377f05408 Removed redundant masterNodeTimeout, already present in the ClusterStateUpdateRequest base class 2013-11-20 10:15:43 +01:00
David Pilato 260531bbb2 NPE in PluginsService when starting elasticsearch with a wrong user
When starting elasticsearch with a wrong linux user, it could generate a `NullPointerException` when `PluginsService` tries to list available plugins in `./plugins` dir.

To reproduce:

* create a plugins directory with `rwx` rights for root user only
* launch elasticsearch from another account (elasticsearch for example)

Related discussion: https://groups.google.com/forum/#!topic/elasticsearch/_WRW4Qfpo7M

Closes #4186.
Closes #4187.
2013-11-20 09:58:20 +01:00
Shay Banon bc54201cfc Running the node stats api while a shard is moving onto the node logs an exception
fixes #4203
2013-11-19 11:54:32 -08:00
Matt Weber a841a422f6 Add a field data based TermsFilter
Add FieldDataTermsFilter that compares terms out of
the fielddata cache. When filtering on a large
set of terms this filter can be considerably faster
than using a standard lucene terms filter.

Add the "fielddata" execution mode to the
terms filter parser to enable the use of
the new FieldDataTermsFilter.

Add supporting tests and documentation.

Closes #4209
2013-11-19 19:18:16 +01:00