Eliminate based on attribute

I would like to eliminate polygons under a certain area into other adjacent polygons (same layer) based on a equal attribute. the process could be describes as follows: 1) it eliminates polygons by border 2) but if attribute from poly 1 is equal to attribute from poly 2 despite that the lenght border corresponds to poly 3 (related to poly2) then poly 2 would be eliminated to poly1 instead of poly 3.