Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jillesvangurp committed Apr 27, 2020
1 parent 3aaa880 commit 7ca3a8d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
Binary file modified book.epub
Binary file not shown.
6 changes: 3 additions & 3 deletions manual/crud-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ Output:
"things" : {
"settings" : {
"index" : {
"creation_date" : "1587991820579",
"creation_date" : "1588008607578",
"number_of_shards" : "1",
"number_of_replicas" : "0",
"uuid" : "H7XXPnFsRTKIvVvdlcVHEQ",
"uuid" : "3yDjaMfcS2Wh5QJjmtOu9w",
"version" : {
"created" : "7060099"
},
Expand All @@ -109,7 +109,7 @@ Output:
}
}
things -> {"_meta":{"content_hash":"VFD04UkOGUHI+2GGDIJ8PQ==","timestamp":"2020-
04-27T12:50:20.565860Z"},"properties":{"amount":{"type":"long","fields":{"abette
04-27T17:30:07.538370Z"},"properties":{"amount":{"type":"long","fields":{"abette
rway":{"type":"double"},"imadouble":{"type":"double"},"somesubfield":{"type":"ke
yword"}}},"title":{"type":"text"}}}
```
Expand Down
8 changes: 4 additions & 4 deletions manual/query-dsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ val results = thingRepository.search {
// it also has filter, should, and mustNot
must(
// it has a vararg list of ESQuery
match("title","quick") {
match("title", "quick") {
// match always needs a field and query
// but boost is optional
boost = 2.0
},
// but the block param is nullable and
// defaults to null
match("title","brown")
match("title", "brown")
)
}
)
Expand All @@ -138,8 +138,8 @@ this is easy too.
val results = thingRepository.search {
// SearchRequest.dsl is the extension function that allows us to use the dsl.
dsl {
this["from"]= 0
this["size"]=10
this["from"] = 0
this["size"] = 10
query(
// custom query constructs an object with an object inside
// as elasticsearch expects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ open class MapBackedProperties internal constructor(
}
}

fun mapProps(block: MapBackedProperties.()->Unit): MapBackedProperties {
fun mapProps(block: MapBackedProperties.() -> Unit): MapBackedProperties {
val mapBackedProperties = MapBackedProperties()
block.invoke(mapBackedProperties)
return mapBackedProperties
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/io/inbot/eskotlinwrapper/SearchDSL.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@ fun customQuery(name: String, block: MapBackedProperties.() -> Unit): ESQuery {
block.invoke(q.queryDetails)
return q
}

Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ class QueryDslManualTest : AbstractElasticSearchTest(indexPrefix = "manual") {
// it also has filter, should, and mustNot
must(
// it has a vararg list of ESQuery
match("title","quick") {
match("title", "quick") {
// match always needs a field and query
// but boost is optional
boost = 2.0
},
// but the block param is nullable and
// defaults to null
match("title","brown")
match("title", "brown")
)
}
)
Expand All @@ -164,8 +164,8 @@ class QueryDslManualTest : AbstractElasticSearchTest(indexPrefix = "manual") {
val results = thingRepository.search {
// SearchRequest.dsl is the extension function that allows us to use the dsl.
dsl {
this["from"]= 0
this["size"]=10
this["from"] = 0
this["size"] = 10
query(
// custom query constructs an object with an object inside
// as elasticsearch expects.
Expand Down Expand Up @@ -206,7 +206,7 @@ class QueryDslManualTest : AbstractElasticSearchTest(indexPrefix = "manual") {
this is the implementation of the match we use above.
"""

snippetFromSourceFile("src/main/kotlin/io/inbot/eskotlinwrapper/SearchDSL.kt","MATCH_QUERY",wrap = true)
snippetFromSourceFile("src/main/kotlin/io/inbot/eskotlinwrapper/SearchDSL.kt", "MATCH_QUERY", wrap = true)

+"""
Writing your own EsQuery subclass should be straight-forward. Just extend `EsQuery` and write a function
Expand Down

0 comments on commit 7ca3a8d

Please sign in to comment.