Apple's magnetic port has been patented, and now no other company can use the same idea to build its charging ports. If this can be achieved for a charging port, I was wondering why a search engine or an e-commerce platform per se can't be patented so that no other competitor would start working on it.
Explanations of Apple's MagSafe patent are here.
The USPTO explains what can be patented under U.S. statute (which is generally informative for all member countries of the Patent Cooperation Treaty):
[A]ny person who “invents or discovers any new and useful process, machine, manufacture, or composition of matter, or any new and useful improvement thereof, may obtain a patent,” subject to the conditions and requirements of the law. The word “process” is defined by law as a process, act, or method, and primarily includes industrial or technical processes. The term “machine” used in the statute needs no explanation. The term “manufacture” refers to articles that are made, and includes all manufactured articles. The term “composition of matter” relates to chemical compositions and may include mixtures of ingredients as well as new chemical compounds. These classes of subject matter taken together include practically everything that is made by man and the processes for making the products.
Interpretations of the statute by the courts have defined the limits of the field of subject matter that can be patented, thus it has been held that the laws of nature, physical phenomena, and abstract ideas are not patentable subject matter.
A patent cannot be obtained upon a mere idea or suggestion. The patent is granted upon the new machine, manufacture, etc., as has been said, and not upon the idea or suggestion of the new machine. A complete description of the actual machine or other subject matter for which a patent is sought is required.
As noted here:
Despite the best efforts of patent offices many patents are granted that may not meet these criteria: that's why a patent can be challenged in court. An invalid patent may stand for many years (or even expire) without ever being reviewed by a court.
It is possible to win and enforce a patent that might not withstand a vigorous administrative or legal challenge.
In fact, there is a great deal of ongoing rule- and law-making regarding what can be patented. It is possible to patent things that you might consider to cover a "search engine" or "e-commerce platform. For example, Amazon.com famously patented "one-click" ordering in the U.S., but its application with the European Patent Office was refused.