Public Whois records were largely instituted to satisfy concerns of intellectual property owners and law enforcement, and also to provide a means for resolving technical issues involving domain names and Web sites. There is an ongoing debate as to what Whois information should be made available and for what purposes.
That said, as long as a specific use of Whois records is not prohibited, it is lawful, whether or not envisioned as a policy reason for establishing a Whois database. For example, ICANN generally requires registrars to license their whois databases to third parties for a $10,000 fee, but prohibits the use of such information in marketing or soliciting customers. You would need to see the terms of the specific license at issue, but under such a bulk license, use of Whois data in indexing and ranking activities may be perfectly acceptable. Mining data from Web site databases for the same purposes, however, is generally illegal and constitutes a Trespass to Chattels, possible violation of the Computer Fraud and Abuse Act and possible breach of an online services agreement.