A user views search results and subjectively determines if a document is desirable or undesirable. Only documents categorized by the user are analyzed for deriving a list of prospective keywords. The frequency of occurrence of each word of each document is derived. Keywords that occur only in desirable documents are good keywords. Keywords that occur only in undesirable documents are bad keywords. Keywords that occurs in both types are dirty keywords. The best keywords are the good keywords with the highest frequency of occurrence. The worst keywords are the bad keywords with the highest frequency of occurrence. A new query phrase includes the highest ranked good keywords and performs filtering using the highest ranked bad keywords. Key phrases are derived to clean dirty keywords into good key phrases. A key phrase also is derived from a good keyword and replaces the good keyword to narrow a search.