Mercurial Hosting > nabble
comparison 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 |
comparison
equal
deleted
inserted
replaced
54:6bd33547304f | 55:11e847f25845 |
---|---|
10 import org.apache.lucene.search.IndexSearcher; | 10 import org.apache.lucene.search.IndexSearcher; |
11 import org.apache.lucene.search.TermQuery; | 11 import org.apache.lucene.search.TermQuery; |
12 import org.apache.lucene.search.Query; | 12 import org.apache.lucene.search.Query; |
13 import org.apache.lucene.search.ScoreDoc; | 13 import org.apache.lucene.search.ScoreDoc; |
14 import org.apache.lucene.search.TopDocs; | 14 import org.apache.lucene.search.TopDocs; |
15 import org.apache.lucene.search.BooleanClause; | |
16 import org.apache.lucene.search.BooleanQuery; | |
15 import org.slf4j.Logger; | 17 import org.slf4j.Logger; |
16 import org.slf4j.LoggerFactory; | 18 import org.slf4j.LoggerFactory; |
17 | 19 |
18 import javax.servlet.ServletException; | 20 import javax.servlet.ServletException; |
19 import javax.servlet.http.HttpServlet; | 21 import javax.servlet.http.HttpServlet; |
66 */ | 68 */ |
67 out.print( "\r\n </body>\r\n</html>\r\n" ); | 69 out.print( "\r\n </body>\r\n</html>\r\n" ); |
68 | 70 |
69 } | 71 } |
70 | 72 |
71 static Query query = new TermQuery(new Term(Site.EMBARRASSING_FLD,"false")); | 73 static BooleanQuery query = new BooleanQuery(); |
74 static { | |
75 query.add(new TermQuery(new Term(Site.EMBARRASSING_FLD,"false")), BooleanClause.Occur.MUST); | |
76 query.add(new TermQuery(new Term(Site.PRIVATE_FLD,"false")), BooleanClause.Occur.MUST); | |
77 } | |
72 | 78 |
73 private static void topSites(PrintWriter out) | 79 private static void topSites(PrintWriter out) |
74 throws ServletException, IOException | 80 throws ServletException, IOException |
75 { | 81 { |
76 IndexSearcher searcher; | 82 IndexSearcher searcher; |