Package com.flaptor.hounder.searcher.sort

Examples of com.flaptor.hounder.searcher.sort.FieldSort


        type = FieldSort.OrderType.INT;
      } else if (typeStr.equals("LONG")) {
        type = FieldSort.OrderType.LONG;
      }
      if (null == subSort) {
        sort = new FieldSort(reverse.equals("true"), name, type);
      } else {
        sort = new FieldSort(reverse.equals("true"), name, type, subSort);
      }
    }
    return sort;
  }
View Full Code Here


                  }
                }
                if ("score".equals(sortField)) {
                    sort = new ScoreSort();
                } else {
                    sort = new FieldSort(reverse, sortField, orderType, sort);
                }
            }
        }

        // Filtering
View Full Code Here

    }

    @TestInfo(testType = TestInfo.TestType.UNIT)
    public void testSortDocs() throws Exception {

        ASort sort = new FieldSort(false,"int",FieldSort.OrderType.INT);
        Vector<Pair<String,Vector<Document>>> docs = new Vector<Pair<String,Vector<Document>>>();
        Vector<Vector<Float>> scores = new Vector<Vector<Float>>();
        Vector<GroupedSearchResults> gsrs = new Vector<GroupedSearchResults>();

        for (int j = 0; j < 3 ; j++) {
View Full Code Here

        indexer.index(group1b);
        indexer.index(group2a);
        indexer.index(group2b);
        indexer.index(group3a);
    Execute.sleep(8000);
        GroupedSearchResults gsr = searcher.search(new MatchAllQuery(),0,3,new StoredFieldGroup("group"),2,null,new FieldSort(false,"group",FieldSort.OrderType.STRING));

        assertEquals(3,gsr.groups());
        assertEquals(2,gsr.getGroup(0).last().size());
        assertEquals(2,gsr.getGroup(1).last().size());
        assertEquals(1,gsr.getGroup(2).last().size());
View Full Code Here

        Execute.sleep(8000);

        GroupedSearchResults newGsr, gsr;
        float newHitRatio, hitRatio;

        newGsr = cacheSearcher.search(new MatchAllQuery(),0,3,new StoredFieldGroup("group"),2,null,new FieldSort(false,"group",FieldSort.OrderType.STRING));
        newHitRatio = cache.getHitRatio();
        for (int i = 0; i < 20; ++i) {
            gsr = newGsr;
            hitRatio = newHitRatio;

            newGsr = cacheSearcher.search(new MatchAllQuery(),0,3,new StoredFieldGroup("group"),2,null,new FieldSort(false,"group",FieldSort.OrderType.STRING));
            newHitRatio = cache.getHitRatio();

            assertTrue(gsr == newGsr);
            assertTrue(hitRatio < newHitRatio);
        }
View Full Code Here

                  }
                }
                if ("score".equals(sortField)) {
                    sort = new ScoreSort();
                } else {
                    sort = new FieldSort(reverse, sortField, orderType, sort);
                }
            }
        }

        // Filtering
View Full Code Here

TOP

Related Classes of com.flaptor.hounder.searcher.sort.FieldSort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.