If I search for closed:yes is:answer
, I got the same number of results as searching for closed:yes
. Is there any way to search for answers on closed questions? Am I not using the correct syntax for searching?
Your search indeed will never return useful results, because you told the search engine you only want to search for answers by setting is:answer
. But answers can't be closed (only questions can), so there are no answers with closed:yes
. So instead, the is:answer
operator is ignored, as if the search used is:question
instead.
That's because closed:...
is only useful for question searches. You can find closed questions with at least one answer instead, by combining closed:yes
with the answers:...
operator, which accepts a range; answers:1...
would find questions with 1 or more answers that are closed:
closed:yes answers:1...
finds more than 750k closed questions with answers.
answers:1
is equivalent to answers:1...
; if you wanted to find closed questions with exactly one answer, use answers:1...1
:
closed:yes answers:1...1
results in a little over 418k closed questions with a single answer.
You could combine either with the isanswered:yes
and / or hasaccepted:yes
operators; these limit question results to posts with at least one upvoted answer and questions with an answer that has been marked as accepted, respectively.
You can't otherwise search for the content of answers that were posted on a closed question.
where closeddate is not null
. Answers don't have their closeddate set when the question gets closed. You end up with just questions. An implementation quirk seems to be that once you selected questions it refuses to take into account answers. I guess that is how Elastic wants it ... – rene Mar 2 at 9:19