text: public static Query CreateJoinQuery(string fromField, bool multipleValuesPerDocument, string toField, Query fromQuery, IndexSearcher fromSearcher, ScoreMode scoreMode){switch (scoreMode){case ScoreMode.None:TermsCollector termsCollector = TermsCollector.Create(fromField, multipleValuesPerDocument);fromSearcher.Search(fromQuery, termsCollector);return new TermsQuery(toField, fromQuery, termsCollector.CollectorTerms);case ScoreMode.Total:case ScoreMode.Max:case ScoreMode.Avg:TermsWithScoreCollector termsWithScoreCollector = TermsWithScoreCollector.Create(fromField, multipleValuesPerDocument, scoreMode);fromSearcher.Search(fromQuery, termsWithScoreCollector);return new TermsIncludingScoreQuery(toField, multipleValuesPerDocument, termsWithScoreCollector.CollectedTerms, termsWithScoreCollector.ScoresPerTerm, fromQuery);default:throw new System.ArgumentException(string.Format("Score mode {0} isn't supported.", scoreMode));}}