The code in Koha::SearchEngine::Elasticsearch::QueryBuilder::_fix_limit_special_cases only sets onloan:false on the query if the availability limit is passed. This is not (a) matching the Zebra behaviour and (b) it should be using the not-onloan-count index (which is configured) but as the indexer is feeded with the output from GerMarcBiblio as-is, it wouldn't include 999$x as the rebuild_zebra.pl counter part does, using the RecordProcessor filters. Looking at rebuild_zebra.pl and the fact that ES doesn't use the EmbedSeeFromHeadings filter either, probably more bugs should be filled. I'm possibly missing some more magic on the QueryParser code that could deal with this things in a different way (than Zebra). But the availability one looks plain wrong so worth filing this bug.
> Looking at rebuild_zebra.pl and the fact that ES doesn't use the EmbedSeeFromHeadings filter either, probably more bugs should be filled. This was fixed in Bug 25030