Package com.flaptor.hounder.searcher

Examples of com.flaptor.hounder.searcher.CompositeSearcher


        } else {
            logger.warn("log4j.properties not found on classpath!");
        }

        Indexer indexer = null;
        CompositeSearcher searcher = null;

        try {
            int indexerPort = DEFAULT_INDEXER_PORT;
            int searcherPort = DEFAULT_SEARCHER_PORT;
            if (args.length == 2) {
                try {
                    indexerPort = Integer.valueOf(args[0]).intValue();
                    searcherPort = Integer.valueOf(args[1]).intValue();
                } catch (NumberFormatException e) {
                    logger.error("Invalid parameters " +e);
                    printUsage();
                    return;
                }
            } else if (args.length != 0) {
                printUsage();
                return;
            }

            indexer = new Indexer();
            XmlrpcServer indexerServer = new XmlrpcServer(indexerPort);
            indexerServer.addHandler("indexer", indexer);
           
            searcher = new CompositeSearcher();
            XmlrpcServer searcherServer = new XmlrpcServer(searcherPort);
            searcherServer.addHandler("searcher", searcher);

            indexerServer.start();
            logger.info("Indexer started on port " +Integer.toString(indexerPort));
            searcherServer.start();
            logger.info("Searcher started on port " +Integer.toString(indexerPort));

        } catch (Exception e) {
            if (indexer != null) {
                indexer.requestStop();
            }
            if (searcher != null) {
                ((Searcher)searcher.getBaseSearcher()).close();
            }
            while (!indexer.isStopped()) {
                Execute.sleep(10);
            }
        }
View Full Code Here


    //TODO see why it crashes if snippets are set
    searcherConfig.set("Searcher.generateSnippets", "false");

        indexer = new Indexer();
        searcher = new CompositeSearcher();
        baseSearcher = (Searcher)searcher.getBaseSearcher();

        cache = new LRUCache<QueryParams, GroupedSearchResults>(500);
        cacheSearcher = new CacheSearcher(baseSearcher, cache); //a cacheSearcher that uses the same baseSearcher
        baseSearcher.addCache(cache);
View Full Code Here

        assertNotNull(suggestor.suggest(new LazyParsedQuery("contetb")));

        Config searcherConfig = Config.getConfig("searcher.properties");
        searcherConfig.set("compositeSearcher.useSpellCheckSuggestQuery", "true");
        searcherConfig.set("searcher.suggestQuerySearcher.dictionaryDir", spellDir.getFile().getAbsolutePath());
        searcher = new CompositeSearcher();

        GroupedSearchResults res = searcher.search(new LazyParsedQuery("contentb"), 0, 10, null, 20, null, null);
        assertEquals(1, res.totalGroupsEstimation());
        res = searcher.search(new LazyParsedQuery("content"), 0, 10, null, 20, null, null);
        assertEquals(0, res.totalGroupsEstimation());
View Full Code Here

        boolean validIndexPresent = (indexUse[0] || indexUse[2]);
        boolean invalidIndexPresent = indexUse[1];


        if (invalidIndexPresent) filterOutput("Cannot find the properties inside the index");
        searcher = new CompositeSearcher();
        baseSearcher = (Searcher)searcher.getBaseSearcher();
        unfilterOutput();

        if (!validIndexPresent) filterOutput("No indexId active");
        try {
View Full Code Here

        // override config, so payloads are used
        searcherConfig.set("SimilarityForwarder.scorers","payload:com.flaptor.hounder.searcher.payload.DatePayloadScorer");

        // restart searcher
        stopSearcher();
        searcher = new CompositeSearcher();
        Execute.sleep(10000);

        // perform query
        gsr = searcher.search(new AndQuery(new TermQuery("content", "contenta"),new PayloadQuery("payload")), 0, 10, new NoGroup(), 1, null, null);
        assertEquals(gsr.groups(),2);
View Full Code Here

TOP

Related Classes of com.flaptor.hounder.searcher.CompositeSearcher

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.