Пример #1
0
 public static void Test()
 {
     for (int i = 0; i < 50; i++)
     {
         var people = new ObjEs();
         people.ObjId   = i;
         people.Content = "A、B、C为数轴上三点,若点C到点A的距离是点C到点B的距离的2倍,则称点C是(A,B)的奇异点,例如图1中,点A表示的数为-1,点B表示的数为2,表示1的点C到点A的距离为2,到点B的距离为1,则点C是(A,B)的奇异点,但不是(B,A)的奇异点";
         people.Name    = "黄平";
         people.Score   = people.ObjId * 0.15;
         ElasticSearchFactory.SaveData(people);
     }
     var result = ElasticSearchFactory.Search <ObjEs>(p => p.Index(new ObjEs().IndexName).Query(
                                                          x => x.TermRange(y => y.Field(a => a.Score).GreaterThan("1.5").LessThan("3.0"))));
 }