To index products in Solr the fields in your schema.xml should be something like this:
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="name" type="text" indexed="true" stored="true"/>
<field name="desc" type="text" indexed="true" stored="true"/>
<field name="catname" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="brandname" type="string" indexed="true" stored="true"/>
</fields>
Notice multiValued="true"
is set for the category name, so products can have more than one category. I don't think you need to send to Solr category Ids or brand Ids, but that depends on your application.