Just an idea (that came to me...): How about creating a TokenStream that returns the results of TrieUtils.trieCode[Long|Int]() with TokenIncrement 0. You should be able to search this with TrieRangeFilter (using the same field name for the highest and lower precision trie fields).
The difficulty is in identifying what type of tokenizer was used (TrieInt, TrieLong etc.) to index the field. The user will need to use the localparam syntax explicitly for us to use IntTrieRangeFilter e.g fq=
tint:[10 TO 100]. I would like to avoid the use of such syntax as far as possible. Creating the field type may be more work than this option, but it can help us use the correct Filter and SortField automatically.
And how about using this for floats, doubles, and dates (which also have corresponding Solr field types)? You could create field descriptions for that too (subclasses of TrieIntField and TrieLongField), to be able to index these types using trie.
Yes, we should support those too.
By the way, when looking through the schema code, I found out, that with Lucene trunk, it is now also possible to sort the "SortableLongField" & others using the new SortField ctors that
LUCENE-1478 introduced. Currently these fields are sorted by SortField.STRING, whcih is inefficient. Just as a side-note.
Thanks for the pointing this out. I'll take a look at this too.