title: intersection of search (in diff. fields) - Lucene
body: <p>I tried following in Lucene 6.2.1:</p>
  
  <p>I have different fields <code>A</code>,<code>B</code>,<code>C</code>,<code>D</code>,<code>E</code> and I make for every field a different <code>searchquery</code>.</p>
  
  <p>Then I want to make a intersection. Show it, when the result is everywhere true.</p>
  
  <p>Someone told me to try this with <code>Booleanquery</code>. So this is my approach:</p>
  
  <pre><code>IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));
  IndexSearcher searcher = new IndexSearcher(reader);
  Analyzer analyzer = new StandardAnalyzer();
  
  BufferedReader in = null;
  in = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
  
  QueryParser parser1 = new QueryParser("A", analyzer);// i have 5 different QueryParser
  Query qPersonen = parser1.parse("searchstring"); // i have also 5 Queries
  booleanQuery.add(qPersonen, BooleanClause.Occur.MUST);
  
  TotalHitCountCollector collector = new TotalHitCountCollector();
  TopDocs results = searcher.search(booleanQuery.build(), 100);
  
  ScoreDoc[] hits = results.scoreDocs;
  int numTotalHits = results.totalHits;
  System.out.println("Results: " + numTotalHits);
  </code></pre>
  
  <p>Why isn't it working? What could be the fault? It always returns no results :(</p>