1. A method for processing a search query having a plurality of search terms for searching for documents, the method comprising: segmenting the query to identify two or more units; expanding the query by selecting one or more substitutable units for at least one unit in the query; calculating a substitution probability for each substitutable unit; for each substitutable unit, calculating a co-occurrence probability with each of the remaining units in the search query; determining an occurrence probability for each substitutable unit; calculating a score based on the combination of the substitution probability, the co-occurrence probability, and occurrence probability; and ranking the documents in an order determined by the score.