Examples of LazyParsedQuery


Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

     */
    public Vector xmlsearch(final String queryStr, final int firstResult, final int groupCount, final Vector groupBy, final int groupSize,final Vector filters, final Vector sort) {
    logger.debug("Search request received in xmlsearch: query \"" + queryStr + "\", first result " + firstResult + ", groupCount " + groupCount);
    String message = "error: ";
    try {
            AQuery query = new LazyParsedQuery(queryStr);
      GroupedSearchResults gsr = searcher.search(query, firstResult, groupCount, generateGroup(groupBy),groupSize, generateFilters(filters), generateSort(sort));
      logger.debug("Ready to return response: " + gsr);
      return groupedSearchResultsToVector(gsr);
    } catch (SearcherException e) {
      message += "searcher exception - " + e.getMessage();
View Full Code Here

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

      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

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

    @Override
    public GroupedSearchResults search(AQuery query, int firstResult, int count, AGroup group, int groupSize, AFilter filter, ASort sort) throws SearcherException{
        GroupedSearchResults results = searcher.search(query, firstResult, count, group, groupSize, filter, sort);
        if (null != results && results.totalResults() > 0) {
            LazyParsedQuery lazyParsedQuery = LazyParsedQuery.findLazyParsedQuery(query);
            if (null != lazyParsedQuery) {
                logger.info(lazyParsedQuery.getQueryString().toLowerCase().trim());
            }
        }
    return results;   
  }
View Full Code Here

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

        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.");
        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

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

        if (args.length != 5) {
            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

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

                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

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

        // TODO: Fix access to config file. (Config.init("xxxx"))
        searcher = new CompositeSearcher();
  }

  public final GroupedSearchResults search(final String queryStr, final int firstResult, final int count,  final AFilter filter, final ASort sort, final AGroup group, final int groupSizethrows SearcherException{
    return searcher.search(new LazyParsedQuery(queryStr), firstResult, count, group, groupSize, filter, sort);
  }
View Full Code Here

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

        GroupedSearchResults sr = null;
        int status = 0;
        String statusMessage = "OK";
        try {
            AQuery query = new LazyParsedQuery(queryString);
            if (null != payloadFields) {
                for (String fieldName : payloadFields) {
                    query = new AndQuery(query, new PayloadQuery(fieldName));
                }
            }
View Full Code Here

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

    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

Examples of com.flaptor.hounder.searcher.query.LazyParsedQuery

            requiresPort = {10000, 10001, 10010, 10011, 10012})
  public void testLatinText() throws SearcherException{
    indexer.index(latin1);
    Execute.sleep(8000);
    GroupedSearchResults sr;
        sr = searcher.search(new LazyParsedQuery("xsín"), 0, 10, noGroup, 1, null, null);
    assertEquals("Searching 'xsín'", 1, sr.totalGroupsEstimation());
        sr = searcher.search(new LazyParsedQuery("xsin"), 0, 10, noGroup, 1, null, null);
    assertEquals("Searching 'xsin'", 1, sr.totalGroupsEstimation());
        sr = searcher.search(new LazyParsedQuery("xcón"), 0, 10, noGroup, 1, null, null);
    assertEquals("Searching 'xcón'", 1, sr.totalGroupsEstimation());
        sr = searcher.search(new LazyParsedQuery("xcon"), 0, 10, noGroup, 1, null, null);
    assertEquals("Searching 'xcon'", 1, sr.totalGroupsEstimation());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.