Package com.flaptor.hounder.searcher.group

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


        checkQueryParameters(tdocs, offset, groupCount);


        AResultsGrouper grouper;
        if (null == groupBy ) {
            grouper = (new NoGroup()).getGrouper(new TopDocsDocumentProvider(tdocs,searcher));
        } else {
            grouper = groupBy.getGrouper(new TopDocsDocumentProvider(tdocs,searcher));
        }
        return grouper.group(groupCount,groupSize,offset);
    }
View Full Code Here


     *
     * If parameter does not match any of this formats, no grouping is made
     */
    private AGroup generateGroup(final Vector vec) {
        if (null == vec || vec.size() == 0)
            return new NoGroup();


        try {
            if ("SIGNATURE".equals((String)vec.get(0))) {
                if (vec.size() == 2 ) {
View Full Code Here

      setProperty("maxSimultaneousQueries", String.valueOf(tls.getMaxSimultaneousQueries()));
      setProperty("simultaneousQueries", String.valueOf(tls.getSimultaneousQueries()));
    }
    try {
            setProperty("searcherException", null);
            searcher.search(new LazyParsedQuery("testing123"), 0, 1, new NoGroup(), 1, null,null);
        } catch (Throwable t) {
            setProperty("searcherException", t.getMessage());
        }
  }
View Full Code Here

        IRemoteSearcher searcher = new RmiSearcherStub(basePort, host);


        //The simplest example.
        System.out.println("Simple search results:\n" + searcher.search(new LazyParsedQuery(query), 0, 10, new NoGroup(), 1, null, null).toString());


        //The same example, with some error management
        GroupedSearchResults gsr = null;
        try {
            gsr = searcher.search(new LazyParsedQuery(query), 0, 10, new NoGroup(), 1, null, null);
        } catch (RpcException e) {
            System.err.println("Error while executing the search." + e);
            System.exit(-1);
        }
        System.out.println("Search successfull.");
View Full Code Here

            printUsage();
            System.exit(-1);
        }
        RmiSearcherStub searcher = new RmiSearcherStub(Integer.parseInt(args[1]), args[0]);
        AQuery query = new LazyParsedQuery(args[2]);
        System.out.println( searcher.search(query, Integer.parseInt(args[3]), Integer.parseInt(args[4]), new NoGroup(), 1, null, null));
    }
View Full Code Here

                Thread.sleep(2000); // Awful hack to wait until first index is loaded.
            } catch (Exception e) {
                System.err.println(e);
            }

            GroupedSearchResults res = ls.search(new LazyParsedQuery(args[1]), new Integer(args[2]).intValue(), new Integer(args[3]).intValue(), new NoGroup(), 1, null, null);
            System.out.println("Obtained " + res.groups() + " results, showing a page of " + res.totalGroupsEstimation() + " results");
            for (int i = 0; i < res.totalGroupsEstimation(); i++) {
                System.out.println("Result #" + (i+1) + ", fields:");
            }
            System.out.println("DEBUG: stopping threads");
View Full Code Here



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

    @TestInfo(testType = TestInfo.TestType.UNIT)
    public void testSuggests() throws Exception {
        AQuery query = new LazyParsedQuery("foo");
        // a foo query should return no results
        GroupedSearchResults gsr = suggestSearcher.search(query,0,10,new NoGroup(),1,null,null);
System.out.println("Suggests: "+gsr.getSuggestedQuery().toString());
        assertTrue(gsr.getSuggestedQuery().toString().contains("bar"));
    }   
View Full Code Here

    }   

    @TestInfo(testType = TestInfo.TestType.UNIT)
    public void testDoesNotSuggest() throws Exception {
        AQuery query = new LazyParsedQuery("dont give results");
        GroupedSearchResults gsr = suggestSearcher.search(query,0,10,new NoGroup(),1,null,null);
        assertTrue(null == gsr.getSuggestedQuery());
    }
View Full Code Here

    class MultiThreadTestHlp extends Thread{
        public GroupedSearchResults results;
        public void run(){
            try {
                results = snippetSearcher.search(new LazyParsedQuery("phrase"), 0, 10, new NoGroup(), 1, null, null);
            } catch (SearcherException e) {
                e.printStackTrace();
                fail(e.getMessage());
            }
        }                   
View Full Code Here

TOP

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

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.