I would like to do the equivalent of this SQL but with Solr as my data store.
SELECT
DISTINCT txt
FROM
my_table;
What syntax would fo
For the DISTINCT
part of your question, I think you may be looking for Solr's field collapsing / grouping functions. It will enable you to specify a field you want unique results from, create a group on those unique values and it will show you how many documents are that group.
You can then use the same substr
stored in a separate field, and collapse on that.