This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.pilato.hibernate.plugins.elasticsearch; | |
import static org.elasticsearch.index.query.xcontent.QueryBuilders.termQuery; | |
import static org.elasticsearch.node.NodeBuilder.nodeBuilder; | |
import static org.junit.Assert.assertEquals; | |
import org.elasticsearch.action.search.SearchResponse; | |
import org.elasticsearch.action.search.SearchType; | |
import org.elasticsearch.client.Client; | |
import org.junit.Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starting test | |
{"ok":true,"_index":"test","_type":"dossier","_id":"1","_version":19} | |
{"ok":true,"_index":"test","_type":"dossier","_id":"2","_version":13} | |
{ | |
"took" : 6, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 5, | |
"failed" : 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dropping index and Creating articles | |
curl -X DELETE "http://localhost:9200/articles" | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["one", "two", "three", "four", "five", "six", "seven"]}' | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["two", "three", "four", "five", "six", "seven"]}' | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["three", "four", "five", "six", "seven"]}' | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["four", "five", "six", "seven"]}' | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["five", "six", "seven"]}' | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["six", "seven"]}' | |
curl -X POST "http://localhost:9200/articles/article" -d '{"tags" : ["seven"]}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.pilato.test.jackson; | |
import org.codehaus.jackson.map.annotate.JsonSerialize; | |
@JsonSerialize | |
public class MyClass { | |
@JsonSerialize | |
private String myProp; | |
@JsonSerialize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"LigneRegistre": { | |
"properties": { | |
"personne": { | |
"dynamic": "true", | |
"properties": { | |
"PersonneMorale": { | |
"dynamic": "true", | |
"properties": { | |
"fax": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT 'localhost:9200/_river/my_river1/_meta' -d '{ | |
"type" : "couchdb", | |
"couchdb" : { | |
"host" : "localhost", | |
"port" : 5984, | |
"db" : "my_db", | |
"filter" : null | |
}, | |
"index" : { | |
"index" : "my_db", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete the index | |
curl -XDELETE http://localhost:9200/twitter | |
# Create the index | |
curl -XPUT http://localhost:9200/twitter | |
# Create the mapping using only fields | |
curl -XPOST http://localhost:9200/twitter/tweet/_mapping -d '{ | |
"tweet" : { | |
"_source" : {"enabled" : false}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ES='http://localhost:9200' | |
ESIDX='test3' | |
ESTYPE='test' | |
curl -XDELETE $ES/$ESIDX/$ESTYPE | |
curl -XPUT $ES/$ESIDX/$ESTYPE/_mapping -d '{ | |
"test" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ES='http://localhost:9200' | |
ESIDX='test3' | |
ESTYPE='test' | |
curl -XDELETE $ES/$ESIDX | |
curl -XPUT $ES/$ESIDX/ -d '{ | |
"settings" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2012-03-29 00:01:06,848][TRACE][index.translog ] [Princess Python] [_river][0] flushing translog, last_flush_time [1332977461805], breached [30m] | |
[2012-03-29 00:01:06,849][TRACE][index.shard.service ] [Princess Python] [_river][0] flush with full[false], refresh[false], force[false] | |
[2012-03-29 00:12:34,702][TRACE][index.translog ] [Princess Python] [devoxx][3] flushing translog, last_flush_time [1332978154502], breached [30m] | |
[2012-03-29 00:12:34,702][TRACE][index.shard.service ] [Princess Python] [devoxx][3] flush with full[false], refresh[false], force[false] | |
[2012-03-29 00:12:44,313][TRACE][index.translog ] [Princess Python] [devoxx][2] flushing translog, last_flush_time [1332978164106], breached [30m] | |
[2012-03-29 00:12:44,313][TRACE][index.shard.service ] [Princess Python] [devoxx][2] flush with full[false], refresh[false], force[false] | |
[2012-03-29 00:12:49,006][TRACE][index.translog ] [Princess Python] [devoxx][1] flushing translog, last_flush_time |
OlderNewer