I am wondering is the www directory needs to be 777 for the search engine/portal to operate correctly or is there a more secure CHMOD setting that will still work?
Nothing should have 777 permissions unless specifically directed to by the installation / script running. Folders should be set to 755.
Most instructions tell you to set the permissions to 777 because it is easier than saying "make the folder writable by your httpd daemon". If your Apache is running as the "nobody" user, you can chmod the folder 775 and chgrp it to the "nobody" group. If Apache is running as the "apache" user, you can do the same thing but replace "nobody" with "apache". I have also seen usernames like "www", "http", "www-data" and "wwwdata". In the end, however, this will only protect you from other users that have logins to the same machine that your website is on that are also malicious. It will not protect you from file uploads or modification that can be made through errors in the PHP code that runs the site. It might be worth trying to find out if you only need the folder to be writable for the install of the search engine portal and you can chmod it back to 755 after it has been installed. There are two things you can do to test this apart from contacting the developers/maintainers of the software. One is to use the software and see if any of the files or the folder itself have their "last modified" date changed when you used it and the other is to simply change the folder back to 755 and see if the software still works.