示例#1
0
        internal HighlightingParameters BuildHighlightParameters()
        {
            HighlightingParameters parameters = new HighlightingParameters()
            {
                Fields = new List <string>()
                {
                    "title"
                },
                Fragsize = 200
            };

            return(parameters);
        }
        private void PrepareHiglightOptions(SolrCompositeQuery query, QueryOptions options)
        {
            var extQuery = query as SolrCompositeQueryWithHighlights;

            if (extQuery == null || extQuery.HighlightParameters == null)
            {
                return;
            }

            var highlightOptions = new HighlightingParameters();

            highlightOptions.Fields = extQuery.HighlightParameters;

            options.Highlight = highlightOptions;
        }
示例#3
0
        public static HighlightingParameters BuildParameters()
        {
            HighlightingParameters parameters = new HighlightingParameters();

            parameters.Fields = new List <string>()
            {
                "coursetitle", "description"
            };

            parameters.Fragsize = 2000;

            //parameters.BeforeTerm = "<span style='color:red'>";
            //parameters.AfterTerm = "</span";

            return(parameters);
        }
示例#4
0
        internal HighlightingParameters BuildHighlightParameters()
        {
            HighlightingParameters parameters = new HighlightingParameters()
            {
                Fields = new List <string>()
                {
                    "*"
                },
                Fragsize   = 200,
                Snippets   = 20,
                BeforeTerm = "<span class = 'highlight'>",
                AfterTerm  = "</span>"
            };;

            return(parameters);
        }
        private void PrepareHiglightOptions(SolrCompositeQuery query, QueryOptions options)
        {
            var extQuery = query as SolrCompositeQueryWithHighlights;

            if (extQuery == null || extQuery.HighlightParameters == null)
            {
                return;
            }

            var highlightOptions = new HighlightingParameters();

            highlightOptions.Fields     = extQuery.HighlightParameters;
            highlightOptions.Snippets   = extQuery.Snippets;
            highlightOptions.BeforeTerm = "<" + extQuery.Htmltag + ">";
            highlightOptions.AfterTerm  = "</" + extQuery.Htmltag + ">";
            highlightOptions.Fragsize   = extQuery.FragmentSize;
            options.Highlight           = highlightOptions;
        }
示例#6
0
 public DSLRun(ISolrConnection connection, ISolrQuery query, ICollection <SortOrder> order, ICollection <ISolrFacetQuery> facets, HighlightingParameters highlight) : this(connection, query, order)
 {
     this.facets    = facets;
     this.highlight = highlight;
 }
示例#7
0
 public IDSLRun <T> WithHighlighting(HighlightingParameters parameters)
 {
     return(new DSLRun <T>(connection, query, order, facets, parameters));
 }