Package com.flaptor.indextank.search

Examples of com.flaptor.indextank.search.DocumentSearcher.search()


    public void testSwitch() throws IOException, ParseException, InterruptedException {
      indexTwelveDocs(this.indexEngine.getIndexer());

        DocumentSearcher searcher = this.indexEngine.getSearcher();

        SearchResults srs = searcher.search(new Query(new TermQuery("text","term1"),null,null),0,10, 0);
    assertEquals("Number of historic results doesn't match", 1, srs.getMatches());
       
        srs = searcher.search(new Query(new TermQuery("text","term11"),null,null),0,10, 0);
    assertEquals("Number of real time results doesn't match", 1, srs.getMatches());
View Full Code Here


        DocumentSearcher searcher = this.indexEngine.getSearcher();

        SearchResults srs = searcher.search(new Query(new TermQuery("text","term1"),null,null),0,10, 0);
    assertEquals("Number of historic results doesn't match", 1, srs.getMatches());
       
        srs = searcher.search(new Query(new TermQuery("text","term11"),null,null),0,10, 0);
    assertEquals("Number of real time results doesn't match", 1, srs.getMatches());

        Query query = new Query(this.indexEngine.getParser().parseQuery("term1 OR term2 OR term3 OR term4 OR term5"),null,null);
        srs = searcher.search(query,0,10, 0);
    assertEquals("Number of real time results doesn't match", 5, srs.getMatches());
View Full Code Here

       
        srs = searcher.search(new Query(new TermQuery("text","term11"),null,null),0,10, 0);
    assertEquals("Number of real time results doesn't match", 1, srs.getMatches());

        Query query = new Query(this.indexEngine.getParser().parseQuery("term1 OR term2 OR term3 OR term4 OR term5"),null,null);
        srs = searcher.search(query,0,10, 0);
    assertEquals("Number of real time results doesn't match", 5, srs.getMatches());
  }

    @TestInfo(testType=SYSTEM)
    public void testSwitchedDuplicates() throws IOException, ParseException, InterruptedException {
View Full Code Here

    @TestInfo(testType=SYSTEM)
    public void testFacetedSearch() throws InterruptedException {
      indexForwardFacetedToDocuments(this.indexEngine.getIndexer());
        DocumentSearcher searcher = this.indexEngine.getSearcher();
       
        SearchResults searchResults = searcher.search(new Query(new TermQuery("text","a"),"a",null), 0, 10, 0);
       
        Map<String, Multiset<String>> facets = searchResults.getFacets();
       
        //System.out.println("Matches: " + searchResults.getMatches());
        //System.out.println(facets);
View Full Code Here

        assertEquals(2, tipoFacet.elementSet().size());
        assertEquals(3, tipoFacet.count("NAH"));
        assertEquals(2, tipoFacet.count("SI"));
       
       
        searchResults = searcher.search(new Query(new TermQuery("text","b"),"b",null), 0, 10, 0);
       
        facets = searchResults.getFacets();
       
        //System.out.println("Matches: " + searchResults.getMatches());
        //System.out.println(facets);
View Full Code Here

    @TestInfo(testType=SYSTEM)
    public void testBackwardsFacetedSearch() throws InterruptedException {
      indexBackwardsFacetedToDocuments(this.indexEngine.getIndexer());
        DocumentSearcher searcher = this.indexEngine.getSearcher();
       
        SearchResults searchResults = searcher.search(new Query(new TermQuery("text","a"),"a",null), 0, 10, 0);
       
        Map<String, Multiset<String>> facets = searchResults.getFacets();
       
        //System.out.println("Matches: " + searchResults.getMatches());
        //System.out.println(facets);
View Full Code Here

        assertEquals(2, tipoFacet.elementSet().size());
        assertEquals(3, tipoFacet.count("NAH"));
        assertEquals(2, tipoFacet.count("SI"));
       
       
        searchResults = searcher.search(new Query(new TermQuery("text","b"),"b",null), 0, 10, 0);
       
        facets = searchResults.getFacets();
       
        //System.out.println("Matches: " + searchResults.getMatches());
        //System.out.println(facets);
View Full Code Here

       
        Multimap<String, String> categoriesFilter = HashMultimap.create();
       
        categoriesFilter.put("PRECIO", "BAJO");
       
    SearchResults searchResults = searcher.search(new Query(indexEngine.getParser().parseQuery("a OR b"),"a OR b", null, categoriesFilter, VariablesRangeFilter.NO_FILTER), 0, 10, 0);
   
    int matches = searchResults.getMatches();
    Map<String, Multiset<String>> facets = searchResults.getFacets();
    //System.out.println(matches);
    //System.out.println(searchResults.getResults());
View Full Code Here

    categoriesFilter = HashMultimap.create();
   
    categoriesFilter.put("TIPO", "NAH");
    categoriesFilter.put("TIPO", "TERCERO");
   
    searchResults = searcher.search(new Query(indexEngine.getParser().parseQuery("a OR b"),"a OR b", null, categoriesFilter, VariablesRangeFilter.NO_FILTER), 0, 10, 0);
   
    matches = searchResults.getMatches();
    //System.out.println(matches);
    //System.out.println(searchResults.getResults());
    //System.out.println(searchResults.getFacets());
View Full Code Here

   
    categoriesFilter.put("TIPO", "NAH");
    categoriesFilter.put("TIPO", "TERCERO");
    categoriesFilter.put("PRECIO", "BAJO");
   
    searchResults = searcher.search(new Query(indexEngine.getParser().parseQuery("a OR b"),"a OR b", null, categoriesFilter, VariablesRangeFilter.NO_FILTER), 0, 10, 0);
   
    matches = searchResults.getMatches();
    //System.out.println(matches);
    //System.out.println(searchResults.getResults());
    //System.out.println(searchResults.getFacets());
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.