I am writing some optimised search code which talks directly to Solr (uses HTTP requests and parses JSON responses). I am skipping the ContentSearch Sitecore API altogether. Some index fields are suffixed with _s of type string and shared (not specific versions per language). Some index fields are suffixed with _t of type text and are non-shared. When I browse the schema with the Solr admin tool, I see that the fields suffixed with _t have related fields e.g. where there is
there are also corresponding fields
__display_name_t_en __display_name_t_fr __display_name_t_it
Can I simply take the Sitecore context language, e.g. en-GB take the first two characters "en" and then append them to the end of my field name (provided it has the _t suffix), or is the logic more complex than this?
Is there some good way to validate field names to avoid ending up with an invalid search query?