diff src/global/web/Index.java @ 55:11e847f25845

hide private forums
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 07 Jul 2021 11:12:00 -0600
parents 56accc959f8c
children 4987e1a38a6c
line wrap: on
line diff
--- a/src/global/web/Index.java	Wed Jul 07 11:36:27 2021 +0300
+++ b/src/global/web/Index.java	Wed Jul 07 11:12:00 2021 -0600
@@ -12,6 +12,8 @@
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TopDocs;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -68,7 +70,11 @@
 
 	}
 
-	static Query query = new TermQuery(new Term(Site.EMBARRASSING_FLD,"false"));
+	static BooleanQuery query = new BooleanQuery();
+	static {
+		query.add(new TermQuery(new Term(Site.EMBARRASSING_FLD,"false")), BooleanClause.Occur.MUST);
+		query.add(new TermQuery(new Term(Site.PRIVATE_FLD,"false")), BooleanClause.Occur.MUST);
+	}
 
 	private static void topSites(PrintWriter out)
 		throws ServletException, IOException