Example #1
0
        public string QueryAnalysisUrl(string fieldValue, string fieldName, SolrSelect <T> .QueryResultType queryResultType = SolrSelect <T> .QueryResultType.json)
        {
            Dictionary <string, ICollection <string> > dictionary = new Dictionary <string, ICollection <string> >();

            dictionary.AddOptions("wt", new string[]
            {
                queryResultType.ToString()
            });
            dictionary.AddOptions("analysis.showmatch", new string[]
            {
                "true"
            });
            dictionary.AddOptions("indent", new string[]
            {
                "true"
            });
            dictionary.AddOptions("analysis.fieldvalue", new string[]
            {
                fieldValue
            });
            dictionary.AddOptions("analysis.fieldname", new string[]
            {
                fieldName
            });
            return(base.SolrServerUrl + "/analysis/field?" + dictionary.BuildParams());
        }
Example #2
0
        public string QueryUrl(string query, IDictionary <string, ICollection <string> > options = null, SolrSelect <T> .QueryResultType queryResultType = SolrSelect <T> .QueryResultType.json)
        {
            options = (options ?? new Dictionary <string, ICollection <string> >());
            StringBuilder stringBuilder = new StringBuilder();

            query = (string.IsNullOrWhiteSpace(query) ? "*:*" : query);
            stringBuilder.AppendFormat("?q={0}", query);
            if (options.Count > 0)
            {
                stringBuilder.Append("&" + options.BuildParams());
            }
            stringBuilder.AppendFormat("&wt={0}", queryResultType.ToString());
            stringBuilder.Append("&indent=true");
            return(base.SolrServerUrl + "/select" + stringBuilder.ToString());
        }