3938 Commits

Author SHA1 Message Date
Martijn van Groningen
afc99ac42c Added id cache size to nodes stats api
Also added bloom cache size the node *rest* api
Closes #2264
2012-09-19 13:16:24 +02:00
Shay Banon
86e88a86b8 expose the highlighter builder Field constructor 2012-09-19 11:47:48 +02:00
Martijn van Groningen
d5aa35e0ea Added better error handling for has_child, has_parent and top_children.
If has_parent, has_child or top_children are executed incorrectly then a better exception is thrown. This gives a better error description when one of these queries or filters is being used in count api.

Closes #2261
2012-09-18 13:26:23 +02:00
Shay Banon
2275b82549 upgrade to testng 6.8 2012-09-17 16:23:18 +02:00
Shay Banon
7924115b90 Disable allocation: New indices allocation not to be disabled by default
When setting cluster.routing.allocation.disable_allocation, it causes new indices primary shards to not be allocated. By default, new indices created should allow to, at the very least, allocate primary shards so they become operations. A new setting, cluster.routing.allocation.disable_new_allocation, allows to also disable "new" allocations.
closes #2258.
2012-09-17 16:00:55 +02:00
Shay Banon
90e0a70e0e cancel allocation command to allow_primary to be cancelled 2012-09-17 12:31:33 +02:00
Martijn van Groningen
42864f7481 Fixed wrong jdoc 2012-09-17 12:00:44 +02:00
Shay Banon
afca5ef15f The reroute command allows to explcitiyly execute a cluster reroute allocation command including specific commands. For example, a shard can be moved from one node to another explicitly, an allocation can be canceled, or an unassigned shard can be explicitly allocated on a specific node.
Here is a short example of how a simple reroute API call:

    curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
        "commands" : [
            {"move" : {"index" : "test", "shard" : 0, "from_node" : "node1", "to_node" : "node2"}},
            {"allocate" : {"index" : "test", "shard" : 1, "node" : "node3"}}
        ]
    }'

An importnat aspect to remember is the fact that once when an allocation occurs, the cluster will aim at rebalancing its state back to an even state. For example, if the allocation includes moving a shard from `node1` to `node2`, in an "even" state, then another shard will be moved from `node2` to `node1` to even things out.

The cluster can be set to disable allocations, which means that only the explicitl allocations will be performed. Obviously, only once all commands has been applied, the cluster will aim to be rebalance its state.

Anohter option is to run the commands in "dry_run" (as a URI flag, or in the request body). This will cause the commands to apply to the current cluster state, and reutrn the resulting cluster after the comamnds (and rebalancing) has been applied.

The commands supporterd are:

* `move`: Move a started shard from one node to anotehr node. Accepts `index` and `shard` for index name and shard number, `from_node` for the node to move the shard "from", and `to_node` for the node to move the shard to.
* `cancel`: Cancel allocation of a shard (or recovery). Accepts `index` and `shard` for index name and shar number, and `node` for the node to cancel the shard allocation on.
* `allocate`: Allocate an unassigned shard to a node. Accepts the `index` and `shard` for index name and shard number, and `node` to allocate the shard to. It also accepts `allow_primary` flag to explciitly specify that it is allowed to explciitly allocate a primary shard (might result in data loss).

closes #2256
2012-09-15 22:56:14 +02:00
Shay Banon
19fdd46c87 upgrade to log4j 1.2.17 2012-09-15 10:16:18 +02:00
Martijn van Groningen
9c04e6a4f4 Clean up has_parent query code Renamed some exception messages and removed method from builder 2012-09-14 19:06:12 +02:00
Martijn van Groningen
cfe76546f2 Added has_parent query The has_parent query works the same as the has_parent filter, by automatically wrapping the filter with a constant_score. It has the same syntax as the has_parent filter. Closes #2254 2012-09-14 17:34:01 +02:00
Shay Banon
7bf233a174 fix cleanup of of has child/parent
check if the collected uids were processed before trying to push them back to the cache
2012-09-14 15:01:21 +02:00
Martijn van Groningen
3cd54fc4ee Improve has_child filter / query performance (#2251) Added a new has_child filter implementation, that works _uid based instead of bitset based. This implementation is about ~2 till ~6 times (depending on the query) faster than the already existing bitset based implementation. 2012-09-14 14:37:29 +02:00
Shay Banon
4dddeeb30c When configuring mmapfs it is not used since 0.19.7, closes #2253. 2012-09-14 14:30:44 +02:00
Shay Banon
ef9974ce2c add serialization options for allocation commands 2012-09-14 14:26:39 +02:00
Martijn van Groningen
2bd9b3aed0 Added has_parent filter (#2243)
The `has_parent` filter accepts a query and a parent type. The query is executed in the parent document space, which is specified by the parent type. This filter return child documents which associated parents have matched. For the rest `has_parent` filter has the same options and works in the same manner as the `has_child` filter.

This is an experimental filter.

Filter example
###################
```
{
    "has_parent" : {
        "parent_type" : "blog"
        "query" : {
            "term" : {
                "tag" : "something"
            }
        }
    }
}
```
The `parent_type` field name can also be abbreviated to `type`.

Memory considerations
###############
With the current implementation, all _id values are loaded to memory (heap) in order to support fast lookups, so make sure there is enough mem for it.

This issue originates from issue #792
2012-09-13 13:35:45 +02:00
Shay Banon
e530f03b94 internal custom allocation commands
add support for internal custom allocation commands, including allocation, move, and cancel (shard).
also, fix #2242, which causes the cluster state to be in inconsistent state when a shard being the source of relocation is failed
2012-09-12 15:13:27 +02:00
Martijn van Groningen
b6a9bd9a31 - Fixed boosting per field with multi_match query. 2012-09-12 11:43:33 +02:00
Shay Banon
fbd352b448 sync with latest guava version of abstract future 2012-09-07 11:13:43 +02:00
Shay Banon
dd970752e7 upgrade to Netty 3.5.7.Final 2012-09-07 11:12:35 +02:00
Shay Banon
8038616fbc add field with text/bytes and builder string 2012-09-06 20:47:13 +02:00
Shay Banon
b26fd600f0 allow to configure cors on http
Allow to configure cors on http, if its enabled or not, and what it should output
2012-09-06 20:35:36 +02:00
Karel Minarik
f659cad8d6 Added proper headers for cross-origin resource sharing (CORS) with Ajax
Previously, when responding to Ajax requests, elasticsearch did not send proper headers for
cross-origin resource sharing (CORS) -- see issues #828, #2186.

With this commit, Ajax requests should be working. Example:

    jQuery.ajax({
      url: "http://localhost:9200/_search",
      type: "POST",
      contentType: 'application/json; charset=UTF-8',
      success: function(data) { console.log(data) }
    });

See:

* http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
* http://www.w3.org/TR/cors/#access-control-allow-headers-response-header

Closes #2186, fixes #828
2012-09-06 17:14:55 +02:00
Shay Banon
f2db8eaca2 IndexMetaData.Builder.Index(String name) isn't renaming this.index
fixed #2236.
2012-09-06 16:30:05 +02:00
Shay Banon
162dfb7011 Upgrade to LZF 0.9.6 2012-09-06 14:55:01 +02:00
Martijn van Groningen
33e7d769ca Fixed no valid missing index type error. 2012-09-05 19:20:53 +02:00
Shay Banon
24ce2ef537 handle EOF when handling arrays as well 2012-09-05 11:40:39 +02:00
Henrik Lindström
26feea8a58 Throw MapperParserException if trying to parse value as object. 2012-09-04 16:12:02 +02:00
Shay Banon
92dfb2b809 Nodes level API: Allow to specify data:true to only execute the APIs on data nodes, closes #2232 2012-09-04 00:03:06 +02:00
Shay Banon
0de8c06900 fix logging if millisecond value in load field data 2012-09-03 23:53:50 +02:00
Shay Banon
82b36e5bb8 upgrade to maven surefire 2.12.3 2012-09-03 20:48:44 +02:00
Shay Banon
a42159f8d5 Shard Allocation: index.routing.allocation.... settings do not "remove" the setting on empty string, closes #2229. 2012-09-03 16:44:23 +02:00
Shay Banon
b055b5a94c Upgrade to mvel 2.1.1, closes #2228. 2012-09-02 21:29:10 +02:00
Shay Banon
8b499dd4fd upgrade to guava 13.0.1 2012-09-02 17:52:40 +02:00
Shay Banon
edfbfc1c87 Update Settings API: Allow body request to be wrapped with settings element to conform with other APIs, closes #2227. 2012-09-02 17:40:08 +02:00
Shay Banon
c834bca43c use java to when no JAVA_HOME defined
remove using "which java", which will give a better error message when java is not available
2012-09-01 11:54:25 +02:00
Shay Banon
6c3847b0a9 move spatial4j and jts to be optional dependencies
allowing data and client nodes to work without them, disabling shapes if needed
2012-09-01 00:05:49 +02:00
Kenn Knowles
e66bd4359a Fix reversed ShingleFilter constructor arguments 2012-08-31 22:25:07 +02:00
Martijn van Groningen
9b29950997 Added fields option to explain api. #2203 2012-08-31 22:19:09 +02:00
Martijn van Groningen
cd0e1226e1 Added a global ignore_malformed index setting. #2220 Also extended the ignore_malformed support to TTL, Ip and timestamp field types. 2012-08-31 22:10:46 +02:00
Shay Banon
888b7cc48f only print failure to reconnect to node from other nodes after several retries 2012-08-31 17:14:04 +02:00
Martijn van Groningen
dea2de3304 Add ignore_indices option for search, multisearch, count and other Broadcast request. #2209 2012-08-27 15:36:14 +03:00
Martijn van Groningen
1d4aee6086 - Explain api opens 2 engine searchers, but closes only 1 engine searcher. Closes #2206 2012-08-27 12:20:02 +03:00
Shay Banon
da61ddee3c 0.19.9 no longer supports /_all/_status, closes #2205. 2012-08-25 14:18:48 +03:00
Shay Banon
dfa67bf071 allow to register custom state associated with cluster state 2012-08-25 00:40:44 +03:00
Martijn van Groningen
bbe735f2cc Fixed issue #2197 2012-08-25 00:38:26 +03:00
uboness
b4b33bb205 Local node master listener
* Fixed an issue where dynamic update to minimum_master_nodes settings would not take immediate effect
* Added LocalNodeMasterListener support to the ClusterService. Enables listening to when the local node becomes/stopped being a master
2012-08-24 02:25:13 +02:00
Shay Banon
36ff6c9b8b add a lock not allowing connecting to nodes while shutting down 2012-08-24 02:23:43 +02:00
Shay Banon
333293babd ignore cancelled key exception as well 2012-08-23 23:35:48 +02:00
Shay Banon
072fcaa760 Bulk UDP, closes #2201
A Bulk UDP service is a service listening over UDP for bulk format requests. The idea is to provide a low latency UDP service that allows to easily index data that is not of critical nature.

The Bulk UDP service is disabled by default, but can be enabled by setting `bulk.udp.enabled` to `true`.

The bulk UDP service performs intenral bulk aggregation of the data and then flushes it based on several parametres:

* `bulk.udp.bulk_actions`: The number of actions to flush a bulk after, defaults to `1000`.
* `bulk.udp.bulk_size`: The size of the current bulk request to flush the request once exceeded, defaults to `5mb`.
* `bulk.udp.flush_interval`: An interval after which the current request is flushed, regarldess of the above limits. Defaults to `5s`.
* `bulk.udp.concurrent_requests`: The number on max in flight bulk requests allowed. Defaults to `4`.

The network settings allowed are:

* `bulk.udp.host`: The host to bind to, defualts to `network.host` which defaults to any.
* `bulk.udp.port`: The port to use, defaults to `9700-9800`.

Here is an example of how it can be used:

    > cat bulk.txt
    { "index" : { "_index" : "test", "_type" : "type1" } }
    { "field1" : "value1" }
    { "index" : { "_index" : "test", "_type" : "type1" } }
    { "field1" : "value1" }

    > cat bulk.txt | nc -w 0 -u localhost 9700
2012-08-23 22:17:37 +02:00