Package org.apache.lucene.search

Examples of org.apache.lucene.search.MultiSearcher


                        .size()];
                for (int i = 0; i < searchers.length; i++) {
                    searchers[i]= new IndexSearcher((Directory)(directories
                        .get(i)));
                }
                luceneSearcher = new MultiSearcher(searchers);
            } else {
                luceneSearcher = new IndexSearcher((Directory) (directories
                        .get(0)));
            }
    }
View Full Code Here


        Searchable[] searchers = new Searchable[indexDirs.length];
        for (int i = 0; i < indexDirs.length; i++) {
          searchers[i] = new IndexSearcher((new File(indexDirs[i].
            toUri()).getAbsolutePath()));
        }
        searcher = new MultiSearcher(searchers);
      } else {
        throw new IOException("no index directory found");
      }

      HTable table = new HTable(conf, new Text(TABLE_NAME));
View Full Code Here


    IndexSearcher searchers[]=new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher=new MultiSearcher(searchers);
    query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    //at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    //query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[]=new Query[2];
    expandedQueries[0]=query.rewrite(reader1);
    expandedQueries[1]=query.rewrite(reader2);
View Full Code Here


    IndexSearcher searchers[]=new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher=new MultiSearcher(searchers);
    QueryParser parser=new QueryParser(FIELD_NAME, new StandardAnalyzer());
    query = parser.parse("multi*");
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    //at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    //query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[]=new Query[2];
    expandedQueries[0]=query.rewrite(reader1);
    expandedQueries[1]=query.rewrite(reader2);
View Full Code Here

        Searchable[] searchers = new Searchable[indexDirs.length];
        for (int i = 0; i < indexDirs.length; i++) {
          searchers[i] = new IndexSearcher((new File(indexDirs[i].getPath().
            toUri()).getAbsolutePath()));
        }
        searcher = new MultiSearcher(searchers);
      } else {
        throw new IOException("no index directory found");
      }

      HTable table = new HTable(conf, TABLE_NAME);
View Full Code Here

        Searchable[] searchers = new Searchable[indexDirs.length];
        for (int i = 0; i < indexDirs.length; i++) {
          searchers[i] = new IndexSearcher((new File(indexDirs[i].getPath().
            toUri()).getAbsolutePath()));
        }
        searcher = new MultiSearcher(searchers);
      } else {
        throw new IOException("no index directory found");
      }

      HTable table = new HTable(conf, TABLE_NAME);
View Full Code Here


    IndexSearcher searchers[]=new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher=new MultiSearcher(searchers);
    QueryParser parser=new QueryParser(FIELD_NAME, new StandardAnalyzer());
    query = parser.parse("multi*");
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    //at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    //query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[]=new Query[2];
    expandedQueries[0]=query.rewrite(reader1);
    expandedQueries[1]=query.rewrite(reader2);
View Full Code Here


    IndexSearcher searchers[]=new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher=new MultiSearcher(searchers);
    QueryParser parser=new QueryParser(FIELD_NAME, new StandardAnalyzer());
    query = parser.parse("multi*");
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    //at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    //query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[]=new Query[2];
    expandedQueries[0]=query.rewrite(reader1);
    expandedQueries[1]=query.rewrite(reader2);
View Full Code Here

    IndexReader reader2 = IndexReader.open(ramDir2);

    IndexSearcher searchers[] = new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher = new MultiSearcher(searchers);
    QueryParser parser = new QueryParser(FIELD_NAME, new StandardAnalyzer());
    query = parser.parse("multi*");
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    // at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    // query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[] = new Query[2];
    expandedQueries[0] = query.rewrite(reader1);
    expandedQueries[1] = query.rewrite(reader2);
View Full Code Here

    IndexReader reader2 = IndexReader.open(ramDir2);

    IndexSearcher searchers[] = new IndexSearcher[2];
    searchers[0] = new IndexSearcher(ramDir1);
    searchers[1] = new IndexSearcher(ramDir2);
    MultiSearcher multiSearcher = new MultiSearcher(searchers);
    QueryParser parser = new QueryParser(FIELD_NAME, new StandardAnalyzer());
    parser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
    query = parser.parse("multi*");
    System.out.println("Searching for: " + query.toString(FIELD_NAME));
    // at this point the multisearcher calls combine(query[])
    hits = multiSearcher.search(query);

    // query = QueryParser.parse("multi*", FIELD_NAME, new StandardAnalyzer());
    Query expandedQueries[] = new Query[2];
    expandedQueries[0] = query.rewrite(reader1);
    expandedQueries[1] = query.rewrite(reader2);
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.MultiSearcher

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.