Codeshare flight miles
I booked a flight with United to the USA and back to Israel. The flight back was a Swiss flight going through ZRH. The remaining leg ZRH-TLV was operated by El-Al.
AFAIK, despite the ticket having the LX (Swiss) code on it, since the flight was operated by El-Al, I don't deserve any miles, and indeed my United MileagePlus account didn't receive any.
However, my partner's Lufthansa Miles&More account did in fact receive miles for that last leg as well.
I tried looking for whether Lufthansa happened to have a partnership with El-Al outside of Star Alliance, but this doesn't seem to be the case, and so I'm left wondering how come my partner did receive points and I haven't.
Am I perhaps wrong to assume that the miles are given according to the operated company in this case?