-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All extract methods will call toString method if the object is not null.
- Loading branch information
1 parent
5d40d19
commit 27946ed
Showing
16 changed files
with
171 additions
and
8 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
resources/issues/85/$ES_HOME/config/templates/template_1.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"template_1" : { | ||
"template" : "authors*", | ||
"settings" : { | ||
"number_of_shards" : 1, | ||
"mapper" : { | ||
"dynamic": false | ||
} | ||
}, | ||
"mappings" : { | ||
"author": { | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"nationality": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"book": { | ||
"_parent": { | ||
"type": "author" | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
curl -XPUT "http://localhost:9200/authors" -d @_01_create-index-with-mapping.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
curl -XPUT "http://localhost:9200/_river/authors85/_meta" -d @_02_mongodb-river-author.json | ||
PAUSE | ||
curl -XPUT "http://localhost:9200/_river/books85/_meta" -d @_02_mongodb-river-book.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
%MONGO_HOME%\bin\mongo < _03-import-document.js | ||
pause | ||
curl -XPOST "localhost:9200/authors/author/_search?pretty=true" -d @_03-has-child-query.json | ||
pause |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"settings" : { | ||
"number_of_shards" : 1, | ||
"mapper" : { | ||
"dynamic": false | ||
} | ||
}, | ||
"mappings" : { | ||
"author": { | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"nationality": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"book": { | ||
"_parent": { | ||
"type": "author" | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "mongodb", | ||
"mongodb": { | ||
"db": "mydb85", | ||
"collection": "authors" | ||
}, | ||
"index": { | ||
"name": "authors", | ||
"type": "author" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "mongodb", | ||
"mongodb": { | ||
"db": "mydb85", | ||
"collection": "books", | ||
"script": "if(ctx.document._parentId) { ctx._parent = ctx.document._parentId; delete ctx.document._parentId;}" | ||
}, | ||
"index": { | ||
"name": "authors", | ||
"type": "book" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"query": { | ||
"has_child": { | ||
"type": "book", | ||
"query": { | ||
"filtered": { | ||
"query": { | ||
"match_all": {} | ||
}, | ||
"filter": { | ||
"term": { | ||
"publisher": "Herge" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use mydb85 | ||
|
||
var author = | ||
{ | ||
"name": "Herge", | ||
"nationality": "Belge" | ||
} | ||
|
||
db.authors.save(author) | ||
|
||
var author1 = db.authors.findOne() | ||
|
||
var book = { | ||
"_parentId": author1._id, | ||
"name": "Titin au Congo", | ||
"genre": "Bande dessinee", | ||
"publisher": "Herge" | ||
} | ||
|
||
db.books.save(book) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"%MONGO_HOME%\bin\mongo.exe" --host localhost --port 27017 --shell create-replicaset.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var adminDb; | ||
function createReplicaset() { | ||
var config = { _id: "replica1", members:[{ _id : 0, host : "localhost:27017" }, { _id : 1, host : "localhost:27018" }, { _id : 2, host : "localhost:27019" }]}; | ||
var cmd = {"replSetInitiate": config}; | ||
adminDb.runCommand(cmd); | ||
//rs.status(); | ||
} | ||
adminDb = db.getSiblingDB("admin"); | ||
createReplicaset(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SET DB_PATH="D:\data\mongodb\rep1-db1" | ||
mkdir %DB_PATH% | ||
"%MONGO_HOME%\bin\mongod.exe" --replSet replica1 --port 27017 --dbpath %DB_PATH% --rest --oplogSize 100 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SET DB_PATH="D:\data\mongodb\rep1-db2" | ||
mkdir %DB_PATH% | ||
"%MONGO_HOME%\bin\mongod.exe" --replSet replica1 --port 27018 --dbpath %DB_PATH% --rest --oplogSize 100 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SET DB_PATH="D:\data\mongodb\rep1-db3" | ||
mkdir %DB_PATH% | ||
"%MONGO_HOME%\bin\mongod.exe" --replSet replica1 --port 27019 --dbpath %DB_PATH% --rest --oplogSize 100 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
start "replica node #1" mongo-node-1.bat | ||
start "replica node #2" mongo-node-2.bat | ||
start "replica node #3" mongo-node-3.bat | ||
sleep 10 | ||
REM start "mongos - port 37017" mongos-node-0.bat |
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