Hope that there is a quick tip that someone already know...
Is it possible to search in multilanguage fields only in the current language values without to search in the default language as fallback? See the quote below.
In other words.. I would like to search only in the current language (Dutch), no matter if some of the Dutch language values are empty. Is it possible?
Nik is right about this. You probably want to change your selector to something like this:
$field = $user->language->isDefault() ? "body" : "body.data" . $user->language;
$matches = $pages->find("$field*=$q");
That will force it to not consider the default language in the matches at all.
However, most of the time you should just do this, which already takes languages into account:
$matches = $pages->find("body*=$q");
So whether the user searches for "Beer" or "Cerve