Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed May 4, 2023
1 parent 55a7e1b commit 5a9111f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
5 changes: 2 additions & 3 deletions samples/src/commonMain/kotlin/samples/docsource/UserDoc.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package samples.docsource

import dev.evo.elasticmagic.doc.BaseDocSource
import dev.evo.elasticmagic.doc.BoundField
import dev.evo.elasticmagic.doc.Document
import dev.evo.elasticmagic.doc.ObjectBoundField
import dev.evo.elasticmagic.doc.SubDocument

class RoleDoc(field: BoundField<BaseDocSource, Nothing>) : SubDocument(field) {
class RoleDoc(field: ObjectBoundField) : SubDocument(field) {
val name by keyword()
val permissions by keyword()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package samples.document.nested

import dev.evo.elasticmagic.doc.BaseDocSource
import dev.evo.elasticmagic.query.Bool
import dev.evo.elasticmagic.doc.BoundField
import dev.evo.elasticmagic.doc.Document
import dev.evo.elasticmagic.doc.ObjectBoundField
import dev.evo.elasticmagic.query.Nested
import dev.evo.elasticmagic.SearchQuery
import dev.evo.elasticmagic.doc.SubDocument

class RoleDoc(field: BoundField<BaseDocSource, Nothing>) : SubDocument(field) {
class RoleDoc(field: ObjectBoundField) : SubDocument(field) {
val name by keyword()
val permissions by keyword()
}
Expand All @@ -27,4 +26,4 @@ val moderators = SearchQuery()
UserDoc.roles.permissions.eq("order"),
)
)
)
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package samples.document.`object`

import dev.evo.elasticmagic.doc.BaseDocSource
import dev.evo.elasticmagic.doc.BoundField
import dev.evo.elasticmagic.doc.Document
import dev.evo.elasticmagic.doc.ObjectBoundField
import dev.evo.elasticmagic.SearchQuery
import dev.evo.elasticmagic.doc.SubDocument

class GroupDoc(field: BoundField<BaseDocSource, Nothing>) : SubDocument(field) {
class GroupDoc(field: ObjectBoundField) : SubDocument(field) {
val id by int()
val name by keyword()
}
Expand Down
5 changes: 2 additions & 3 deletions samples/src/commonMain/kotlin/samples/querying/Nodes.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package samples.querying

import dev.evo.elasticmagic.SearchQuery
import dev.evo.elasticmagic.doc.BaseDocSource
import dev.evo.elasticmagic.doc.BoundField
import dev.evo.elasticmagic.doc.Document
import dev.evo.elasticmagic.doc.MappingField
import dev.evo.elasticmagic.doc.ObjectBoundField
import dev.evo.elasticmagic.doc.SubDocument
import dev.evo.elasticmagic.query.Bool
import dev.evo.elasticmagic.query.DisMax
Expand All @@ -15,7 +14,7 @@ import dev.evo.elasticmagic.query.QueryExpressionNode

import kotlin.random.Random

class TranslationDoc(field: BoundField<BaseDocSource, Nothing>) : SubDocument(field) {
class TranslationDoc(field: ObjectBoundField) : SubDocument(field) {
val en by text()
val de by text()
val ru by text()
Expand Down

0 comments on commit 5a9111f

Please sign in to comment.