Package org.sindice.siren.demo

Examples of org.sindice.siren.demo.SimpleSearcher


      indexer.close();
    }
  }

  public void search() throws QueryNodeException, IOException {
    final SimpleSearcher searcher = new SimpleSearcher(indexDir);
    final String[] keywordQueries = this.getKeywordQueries();
    final String[] jsonQueries = this.getJsonQueries();

    assert keywordQueries.length == jsonQueries.length;

    for (int i = 0; i < keywordQueries.length; i++) {
      Query q = searcher.parseKeywordQuery(keywordQueries[i]);
      logger.info("Executing keyword query: '{}'", keywordQueries[i]);
      String[] results = searcher.search(q, 1000);
      logger.info("Keyword query returned {} results: {}", results.length, Arrays.toString(results));

      q = searcher.parseJsonQuery(jsonQueries[i]);
      logger.info("Executing json query: '{}'", jsonQueries[i]);
      results = searcher.search(q, 1000);
      logger.info("Json query returned {} results: {}", results.length, Arrays.toString(results));
    }

  }
View Full Code Here


      indexer.close();
    }
  }

  public void search() throws QueryNodeException, IOException {
    final SimpleSearcher searcher = new SimpleSearcher(indexDir);
    final String[] keywordQueries = this.getKeywordQueries();
    final String[] jsonQueries = this.getJsonQueries();

    assert keywordQueries.length == jsonQueries.length;

    for (int i = 0; i < keywordQueries.length; i++) {
      Query q = searcher.parseKeywordQuery(keywordQueries[i]);
      logger.info("Executing keyword query: '{}'", keywordQueries[i]);
      String[] results = searcher.search(q, 1000);
      logger.info("Keyword query returned {} results: {}", results.length, Arrays.toString(results));

      q = searcher.parseJsonQuery(jsonQueries[i]);
      logger.info("Executing json query: '{}'", jsonQueries[i]);
      results = searcher.search(q, 1000);
      logger.info("Json query returned {} results: {}", results.length, Arrays.toString(results));
    }

  }
View Full Code Here

TOP

Related Classes of org.sindice.siren.demo.SimpleSearcher

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.