Swappiness can be set from 0 to 100. The default is 60 and the lower it is the more the computer will try to keep everything in RAM.
If you want to temporarily change the swappiness then run this command with desired swappiness level:
sudo sysctl vm.swappiness=10
Alternatively if you want the change to be permanent then edit this file:
sudo gedit /etc/sysctl.conf
Set swappiness to the desired level (in this case 1) by either modifying this line in the file "/etc/sysctl.conf" or if it doesn't exist, add it at the end.
vm.swappiness=1
Reboot the computer for the change to take effect.