It depends on what you want to take from the specific solo you wish to learn. If you like only a few licks in a performance, there’s nothing wrong with learning only small sections of other people’s solos. As long as you understand the context that you’re going to extract these chunks from, you should be fine. On the other hand, if you like a solo in its entirety, and maybe you want to learn how the solo is structured, you should probably study the entire thing. Bear in mind that, whichever approach you choose to have, you don’t have to learn everything note by note religiously. You can adapt licks and phrases to your playing right away!