1. A method to be executed at least in part in a computing device for training a parser to optimize search operations, the method comprising: receiving a query and a plurality of returned documents with relevance judgments; parsing the query and the documents to obtain parse trees; computing tree edit distances for each query-document pair based on the parse trees; incorporating the tree edit distances to a ranking function employed for ranking the documents for the received query; determining updated parser parameters from the ranking function; and updating the parser with the updated parser parameters in an iterative manner until a predefined threshold is reached.