Open jonsgreen opened 3 months ago
For reference I have also posted this question on stackoverflow with a few more details.
So I figured out a bit of a hack where I used Searchkick's main query building functionality with execute: false
and misspellings: true
and pulled them out of the body and then merged those together with must
/should
and passed them back into a final search
call using the advanced search body
option.
I am curious if there would be some way to abstract out the query building part of Query#prepare to make this a bit easier to do? I also don't know how much the code is currently evolving to support a new query DSL.
Anyhow, this is a great gem and I would be happy to try to contribute something but I suspect that there is a lot of complexity in this part of the code and I would need some guidance.
I feel hesitant to submit this issue since I am certain it has been covered before although I am unable to find any results that match. I should also preface that I am currently using version 4.6.3 because of being stuck on an earlier version of Elasticsearch.
We have the need to be able to build some more complex search queries that logically combine
and
s withor
s. We can currently achieve some of what we desire by using the_and
and_or
in awhere
filter however we then lose the analyzer combining that we get from the main query.We could also build up a more complex search by using the
body
option but again we would lose the analyzer configuration that Searchkick provides automatically for the main query.Is there currently a way to combine some of the default behavior one gets for the main query into the subqueries with
_or
and_and
with Searchkick? If not, is this a feature that would be desired?I am trying to keep this simple but can add some examples if that would be helpful.
If this feature request issue is totally out of bounds please close it and/or redirect me elsewhere.