title: Using Highlighter for highlighting Phrase query
body: <p>Am using <a href="http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/search/highlight/package-summary.html" rel="nofollow noreferrer">this</a> version of Lucene highlighter.net API.
  I want to get a phrase highlighted only when ALL of its words are present in the search results..But,am not able to do so....for example, if my input search string is "Leading telecom company", then the API  only highlights "telecom" in the results if the result does not contain the words "leading" and "company"...</p>
  
  <p>Here is the code i'm using:</p>
  
  <pre><code>SimpleHTMLFormatter htmlFormatter = new SimpleHTMLFormatter();
  
  var appData = (string)AppDomain.CurrentDomain.GetData("DataDirectory");
  var folderpath = System.IO.Path.Combine(appData, "MyFolder");
  
  indexReader = IndexReader.Open(folderpath);
  
  Highlighter highlighter = new Highlighter(htmlFormatter, new QueryScorer(finalQuery.Rewrite(indexReader)));
  
  highlighter.SetTextFragmenter(new SimpleFragmenter(800));
  
  int maxNumFragmentsRequired = 5;
  
  string highlightedText = string.Empty;
  
  TokenStream tokenStream = this._analyzer.TokenStream(fieldName, new System.IO.StringReader(fieldText));
  
  highlightedText = highlighter.GetBestFragments(tokenStream, fieldText, maxNumFragmentsRequired, "...");
  
  return highlightedText;
  </code></pre>
  
  <p>Please help!</p>