I think I misunderstood what you want to achieve here :
But if you want to exclude ONLY the terms mentioned once?
There's one approach where you could add the term_vectors data (term_frequency), into your documents during the indexing process, then query on the term_frequency for the specific term.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.