Search optimisation and automatic classification