We introduce matching polynomials of hypergraphs and then an ordering on hypertrees by positivity of the difference of matching polynomials. It is shown that the ordering of hypertrees is compatible with the order of their spectral radii in value. However, the determination of the ordering of hypertrees is usually easier than comparing their spectral radius directly. Using matching polynomial method, together with edge-moving theorem and so on, the first two largest hypertrees among all hypertrees with given size and diameter can be determined.