1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace CoreEntity.ESEntity
- {
- public class EsCommon
- {
- /// <summary>
- /// JSON转对象
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <param name="input"></param>
- /// <returns></returns>
- public static T FromJSON<T>(string input)
- {
- try
- {
- return JsonConvert.DeserializeObject<T>(input);
- }
- catch (Exception ex)
- {
- string a = ex.Message;
- return default(T);
- }
- }
- }
- public class Total
- {
- /// <summary>
- ///
- /// </summary>
- public int value { get; set; }
- /// <summary>
- ///
- /// </summary>
- public string relation { get; set; }
- }
- public class Hits<T>
- {
- /// <summary>
- ///
- /// </summary>
- public Total total { get; set; }
- /// <summary>
- ///
- /// </summary>
- public string max_score { get; set; }
- /// <summary>
- ///
- /// </summary>
- public List<HitsItem<T>> hits { get; set; }
- }
- }
|