Q:

Can solr highlight two different search terms in two different color? 

I am new to solr and have been asked to implement search result highlighting.  My search query is something like this,
query = text like 'searchterm1' AND 'searchterm2'
Now I need to instruct solr to highlight 'searchterm1', 'searchterm2' in yellow and blue colors respectively.  Is this even possible to do with solr?  and if yes how do I go about it? 
This is the code snippet that is currently highlighting the search result. 
    private AbstractSolrQuery _query = new SolrQuery(searchterm1) && new SolrQuery(searchterm2);

    public SolrQueryResults<Document> Execute(string defaultField)
    {
        var results = _solr. Query(_query, new QueryOptions
        {
            Rows = 100,
            Fields = Document. GetPropertiesExceptList(new List<string>{"text","text_exact"}).ToArray(),
            ExtraParams = new Dictionary<string, string> {
                    { "df", defaultField },
                    { "hl.fragsize", "0" },
                    { "hl", "true" }
            }
        });

        Highlight(results);
        return results;
    }

    private void Highlight(SolrQueryResults<Document> results)
    {
        foreach (var result in results)
        {
            foreach (var highlightedSnippet in results. Highlights[result. Id.ToString()])
            {
                result. SetProperty("content", highlightedSnippet. Value. ToList());
            }
        }
    }

Any help with this would be very much appreciated,
Thanks

A:

You can check upon hl.fragmentsBuilder which will allow you to return the snippets in different color.  I am just not sure if it applies to search terms, matches or field.