Package com.flaptor.hounder.searcher.group

Examples of com.flaptor.hounder.searcher.group.StoredFieldGroup


                }
            } else if ("STORED".equals((String)vec.get(0))){
                if (vec.size() != 2) {
                    throw new IllegalArgumentException("Wrong parameter count: \"STORED FIELDNAME\" needed. ");
                }
                return new StoredFieldGroup((String)vec.get(1));
            } else {
                throw new IllegalArgumentException("Supported arguments are \"null\", [ \"STORED\", \"FIELDNAME\"], [\"SIGNATURE\"] and [ \"SIGNATURE\",\"FIELDNAME\"].");
            }
        } catch (ClassCastException e) {
            throw new IllegalArgumentException("Supported arguments are \"null\", [ \"STORED\", \"FIELDNAME\"], [\"SIGNATURE\"] and [ \"SIGNATURE\",\"FIELDNAME\"].");
View Full Code Here


        System.out.println("Search successfull.");
        System.out.println(gsr.toString());


        //Now the same example with grouping:
        AGroup group = new StoredFieldGroup(groupByField);
        System.out.println("Simple search successful.\n" + searcher.search(new LazyParsedQuery(query), 0, 10, group, 3, null, null).toString()); //up to 3 consecutive results within the same group.
    }
View Full Code Here

        AGroup group = new NoGroup();
        if (groupParam != null) {
            if (groupParam.equals("signature")) {
                group = new TextSignatureGroup("text");
            } else {
                group = new StoredFieldGroup(groupParam);
            }
        }
        int groupSize=1;
        String groupSizeParam = getParameter(params,"group_size");
        if (groupSizeParam != null) {
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

        indexer.index(group1b);
        indexer.index(group2a);
        indexer.index(group2b);
        indexer.index(group3a);
    Execute.sleep(8000);
        GroupedSearchResults sr = searcher.search(new MatchAllQuery(),0,3,new StoredFieldGroup("group"), 5,null,null);

        assertEquals(3,sr.groups());
    }
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

        Execution<Void> execution = new Execution<Void>();
        for (int times = 0; times < 50; times++) {
            execution.addTask(new Callable<Void>() {
                public Void call() throws Exception {
                    GroupedSearchResults gsr = multiSearcher.search(new MatchAllQuery(),0,docsPerSearcher*numServers,new StoredFieldGroup("group"),docsPerGroup,null,null);

                    if (docsPerSearcher / docsPerGroup != gsr.groups()) throw new Exception("Not the same count of groups.");

                    for (int i = 0; i < gsr.groups(); i++) {
                        if (docsPerGroup != gsr.getGroup(i).last().size()) {
View Full Code Here

        // Group (uni-valued)
        String groupParam = getParameter(params,"group");
        AGroup group = new NoGroup();
        if (groupParam != null) {
            if (groupParam.equals("site")) {
                group = new StoredFieldGroup("site");
            } else if (groupParam.equals("signature")) {
                group = new TextSignatureGroup("text");
            }
        }
        int groupSize=1;
View Full Code Here

TOP

Related Classes of com.flaptor.hounder.searcher.group.StoredFieldGroup

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.