Posted on 23/03/2017 10:28:50
Not that I can think of.
You can either create an analyzer your self - it should be pretty simple:
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.Search;
using Lucene.Net.Store;
public class FirstLetterAnalyzer : Analyzer
{
public override TokenStream TokenStream(string fieldName, System.IO.TextReader reader)
{
TokenStream tokenStream = new KeywordTokenizer(reader);
//find the first letter of the first token and return that in a new token stream
return tokenStream;
}
}
An alternative would be to create a IIndexBuilderExtender<ContentIndexBuilder> that extends the document with a field of your choice - and add just the first letter of another field to it. That is a more custom implementation, whereas the analyzer is more reusable.