Military members still have freedom of speech rights. More tightly regulated in some instances than civilians, but the right isn't taken away. Even as a civilian there are restrictions on your freedom of speech.
Similar for the fourth amendment. There are exceptions for civilians, and a different set of exceptions for military members, based on government need.
The Constitution applies to all US citizens, military or not.