ref #8477 Set allow duplicates to false when creating a term tree