Q:

Defining a Sitecore Field in Solr's schema.xml

I have a custom text field on a Data Template in my Sitecore 7 instance called CountryName.  I've set up a search result item that returns this field.  
    [IndexField("CountryName")]
    public string CountryName { get; set; }

The field is being indexed by Solr due to the catchall Sitecore configuration in my Solr schema.xml.  However, using the default tokenizer causes calls to sort this field to be problematic and sort out of order.  I'd prefer to use a field type of alphaOnlySort in order to mitigate this problem. 
I've tried adding the following two lines to my Solr Schema.xml file, with no luck:
<field name="CountryName" type="alphaOnlySort" indexed="true" stored="true" />
<dynamicField name="Country*" type="alphaOnlySort" indexed="true" stored="true" />

This hasn't worked.  If I change the *_t DynamicField definition to use alphaOnlySort, it works like a charm.  I know I'm simply missing a step somewhere.  Can someone please point out where I'm missing a step?  Thanks! 

A:

You need to match the field name that SiteCore is sending.  You can check that in Admin UI or just by querying directly against the Solr index. 
I don't know Sitecore, but from your description, it must be adding _t suffixes to the names to make sure they match to the dynamicField definition. 
So, you may need to use:

<field name="CountryName_t" type="alphaOnlySort" indexed="true" stored="true" />

And remember to reindex afterwards.