Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter source fields by a document source #66

Open
anti-social opened this issue Apr 26, 2022 · 0 comments
Open

Filter source fields by a document source #66

anti-social opened this issue Apr 26, 2022 · 0 comments

Comments

@anti-social
Copy link
Owner

Having following document and its doc source:

object UserDoc : Document() {
    val id by long()
    val name by string()

    override val dynamicTemplates : DynamicTemplates() {
        val ids by template(
            mapping = long(index = false).subFields(::IdSubFields),
            match = "*_id",
        )
    )
}

class UserDocSource : DocSource() {
    val id by UserDoc.id
    val name by UserDoc.name
    val ids by UserDoc.dynamicTemplates.ids
}

We should be able to filter source fields in a search query:

SearchQuery().source(UserDocSource())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant