Gnats or midges (both biting and non biting) refer to flies below a certain size from the suborder Nematocera. The names are interchangeable. They breed in moist, warm locations and are attracted to decaying material, carbon dioxide sources and sweet smells. Spreading manure, removing rotting plant material and avoiding sweet smells can help. Swat is great for targeted areas like ears. Sprays that contain permethrins, dish soap (lemon or citrus scented with few harsh ingredients) a few drops in a small squirt bottle mixed with a little baking soda can help when sprayed directly on them as it kills them. For traps a couple of spoonfuls of apple cider vinegar, one of sugar and several drops of dishsoap mixed in a quart of water is more pleasant to deal with than rotting fruit water but both work. Adding fresh vinegar after a few days refreshes the solution and when there are a layer of the offending insects dump and start over.