Been playing with a simple idea to introduce basic dynamic queries by making them conditional. ie
val query = bool {
must {
term { "user" to "kimchy" }
}
filter(isTech()) {
term { "tag" to "tech" }
}
filter(!isTech()) {
match_all { }
}
must_not {
range {
"age" to {
from = 10
to = 20
}
}
}
should = listOf(
term(isAmazing()) { "tag" to "wow" },
term { "tag" to "elasticsearch" })
minimum_should_match = 1
boost = 1.0f
}
I'm not overly happy with the implementation, so interested if you have any other ideas - I haven't let it stew in my head for long so it's a little raw, and I haven't used it in anger to see how much it pollutes the DSL in a real world scenario.
Been playing with a simple idea to introduce basic dynamic queries by making them conditional. ie
I'm not overly happy with the implementation, so interested if you have any other ideas - I haven't let it stew in my head for long so it's a little raw, and I haven't used it in anger to see how much it pollutes the DSL in a real world scenario.