Answer the question
In order to leave comments, you need to log in
How to filter based on the number of nested objects?
I pass some_date and some_size
as parameters to the search .
How to form a query for the filter so that only those articles are returned whose number of comments created before some_date was less than some_size
I have an Article and Comment model followed by mapping:
"mappings" : {
"article" : {
"properties" : {
"comments" : {
"type" : "nested",
"properties" : {
"date" : {
"type" : "date",
"format" : "dateOptionalTime"
}
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Well, you can create a separate field that will be substituted during indexing.
Or use script filter
https://www.elastic.co/guide/en/elasticsearch/refe...
Here is a similar question, only about sorting.
stackoverflow.com/questions/19609498/elastic-searc...
P.Syu Curious to know why the comments inside the article needed to be written down?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question