Terms expansion and haystack backend tweaks