title: Count matching terms in Lucene
body: <p>I am searching in a field with Lucene_35. I would like to get how many words from my term match the field.
  For example my field is <em>"JavaServer Faces (JSF) is a Java-based Web application framework intended to simplify development integration of web-based user interfaces."</em>, my query term is <em>"java/jsf/framework/doesnotexist"</em> and want result 3 since only <em>"java"</em>, <em>"jsf"</em> and <em>"framework"</em> are present in the field.
  Here is a simple example I am following:</p>
  
  <pre><code> public void explain(String document, String queryExpr) throws Exception {
  
          StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
          Directory index = new RAMDirectory();
          IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_35, analyzer);
          IndexWriter w = new IndexWriter(index, config);
          addDoc(w, document);
          w.close();
          String queryExpression = queryExpr;
          Query q = new QueryParser(Version.LUCENE_35, "title", analyzer).parse(queryExpression);
  
          System.out.println("Query: " + queryExpression);
          IndexReader reader = IndexReader.open(index);
          IndexSearcher searcher = new IndexSearcher(reader);
          TopDocs topDocs = searcher.search(q, 10);
          for (int i = 0; i &lt; topDocs.totalHits; i++) {
              ScoreDoc match = topDocs.scoreDocs[i];
              System.out.println("match.score: " + match.score);
              Explanation explanation = searcher.explain(q, match.doc); //#1
              System.out.println("----------");
              Document doc = searcher.doc(match.doc);
              System.out.println(doc.get("title"));
              System.out.println(explanation.toString());
          }
          searcher.close();
      }
  </code></pre>
  
  <p>The output with the above mentioned parameters is:</p>
  
  <pre><code> 0.021505041 = (MATCH) product of:
    0.028673388 = (MATCH) sum of:
      0.0064956956 = (MATCH) weight(title:java in 0), product of:
        0.2709602 = queryWeight(title:java), product of:
          0.30685282 = idf(docFreq=1, maxDocs=1)
          0.8830299 = queryNorm
  </code></pre>
  
  <p>....</p>
  
  <pre><code>     0.033902764 = (MATCH) fieldWeight(title:framework in 0), product of:
          1.4142135 = tf(termFreq(title:framework)=2)
          0.30685282 = idf(docFreq=1, maxDocs=1)
          0.078125 = fieldNorm(field=title, doc=0)
    0.75 = coord(3/4)
  </code></pre>
  
  <p>I want to get this 3/4 as a result.</p>
  
  <p>Regards!</p>