I tried this Lucene code example, which worked:
http://snippets.dzone.com/posts/show/8965
However changing:
Query query = parser.parse("st.");
to
Query query = parser.parse("t");
returned zero hits.
How to write a Lucene query that returns all words containing the letter "t" ?
(max nbr of hits to return = 20)
Edit: here's what worked:
RegexQuery regexquery = new RegexQuery(new Term("fieldname", ".t."));
isearcher.search(regexquery, collector);
System.out.println("collector.getTotalHits()=" + collector.getTotalHits());