I ask because, although this is more a matter of architecture, there are excellent languages for small/mid scale or even larger scale search engines in Java (Lucene and upwards, Solr, etc projects that use it).
For a small embedded search engine, you could get by with just something like Sqlite and some reverse indexes.
For Google scale, it mostly depends on architecture and infrastructure than language. Java, Rust, C++, Go will all do fine for example.