Package org.apache.xindice.core.query.ftsearch

Examples of org.apache.xindice.core.query.ftsearch.Searcher$ResultSet


    row2.getValues().addAll(Lists.newArrayList(textValue2, booleanValue2, numberValue2));

    Row row3 = new Row();
    row3.getValues().addAll(Lists.newArrayList(textValue3, booleanValue3));

    ResultSet resultSet1 = new ResultSet();
    resultSet1.getColumnTypes().addAll(Lists.newArrayList(column1, column2, column3));
    resultSet1.getRows().addAll(Lists.newArrayList(row1, row2));

    ResultSet resultSet2 = new ResultSet();
    resultSet2.getColumnTypes().addAll(Lists.newArrayList(column1, column2));
    resultSet2.getRows().addAll(Lists.newArrayList(row3));

    Pql.combineResultSets(resultSet1, resultSet2);
  }
View Full Code Here


      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    private ResultMessage resultMessage(List<PermissionDetails> details)
    {
        if (details.isEmpty())
            return new ResultMessage.Void();

        ResultSet result = new ResultSet(metadata);
        for (PermissionDetails pd : details)
        {
            result.addColumnValue(UTF8Type.instance.decompose(pd.username));
            result.addColumnValue(UTF8Type.instance.decompose(pd.resource.toString()));
            result.addColumnValue(UTF8Type.instance.decompose(pd.permission.toString()));
        }
        return new ResultMessage.Rows(result);
    }
View Full Code Here

    private ResultMessage resultMessage(List<PermissionDetails> details)
    {
        if (details.isEmpty())
            return new ResultMessage.Void();

        ResultSet result = new ResultSet(metadata);
        for (PermissionDetails pd : details)
        {
            result.addColumnValue(UTF8Type.instance.decompose(pd.username));
            result.addColumnValue(UTF8Type.instance.decompose(pd.resource.toString()));
            result.addColumnValue(UTF8Type.instance.decompose(pd.permission.toString()));
        }
        return new ResultMessage.Rows(result);
    }
View Full Code Here

        final int[] ttls;
        final long now;

        private ResultSetBuilder(long now)
        {
            this.resultSet = new ResultSet(getResultMetadata().copy(), new ArrayList<List<ByteBuffer>>());
            this.selectors = newSelectors();
            this.timestamps = collectTimestamps ? new long[columns.size()] : null;
            this.ttls = collectTTLs ? new int[columns.size()] : null;
            this.now = now;
        }
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.query.ftsearch.Searcher$ResultSet

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.