Package com.flaptor.hounder.indexer

Examples of com.flaptor.hounder.indexer.Indexer$QueueProcessorThread


        org.apache.log4j.PropertyConfigurator.configureAndWatch(log4jConfigPath);
        } 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


        searcherConfig.set("ReloadableIndexSearcher.minTimeBetweenIndexes", "1000");
        searcherConfig.set("ReloadableIndexSearcher.sleepTime", "1000");
        searcherConfig.set("Searcher.generateSnippets", "false");
    searcherConfig.set("clustering.enable", "false");

        Indexer indexer = new Indexer();
        for (int i = 0; i < docsPerSearcher ; i++) {
            addTemplate.setAttribute("content", "content " + numServer);
            addTemplate.setAttribute("documentId", String.valueOf(i) + "-" + String.valueOf(numServer));
            addTemplate.setAttribute("group", "group"+String.valueOf(i/docsPerGroup));
            indexer.index(addTemplate.toString());
            addTemplate.reset();
        }
        indexers.add(indexer);

        ISearcher baseSearcher = new CompositeSearcher();
View Full Code Here

        // some error messages saying that the indexer can connect to the searcher
        int[] lenA={5};
        String[] fieldA={"text"};
        snippetSearcher= new SnippetSearcher(new CompositeSearcher(), fieldA, lenA, FRAG_SEP, PHRASE_BOUND , false, "<B>", "</B>");

        indexer = new Indexer();
        // ------ document-1 ---------------
        addTemplate.setAttribute("text", "This is a simple phrase");
        addTemplate.setAttribute("documentId", "doc-1");
        indexer.index(addTemplate.toString());
        addTemplate.reset();
View Full Code Here

TOP

Related Classes of com.flaptor.hounder.indexer.Indexer$QueueProcessorThread

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.