changeset 55:11e847f25845

hide private forums
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 07 Jul 2021 11:12:00 -0600
parents 6bd33547304f
children 62faaba01dd2
files src/global/web/Index.java src/global/web/Index.jtp
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r 6bd33547304f -r 11e847f25845 src/global/web/Index.java
--- 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
diff -r 6bd33547304f -r 11e847f25845 src/global/web/Index.jtp
--- a/src/global/web/Index.jtp	Wed Jul 07 11:36:27 2021 +0300
+++ b/src/global/web/Index.jtp	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;
 
@@ -145,7 +147,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