line = line.trim(); String[] parts = line.split("\\s+", 6); rtr.add(new ScoredDoc(0, Double.parseDouble(parts[4]), (short) 0, new String[] { parts[2] }, metaOffset));
line = line.trim(); String[] parts = line.split("\\s+", 6); rtr.add(new ScoredDoc(0, Double.parseDouble(parts[4]), (short) 0, new String[] { parts[2] }, metaOffset));
public ScoredDocList getResults() { ResultSet rs = this.getResultSet(); if (rs == null) throw new IllegalStateException("No resultset found"); final String[] metaKeys = rs.getMetaKeys(); Results rtr = new Results(metaKeys); Map<String,Integer> metaoffsets = new HashMap<>(); final int metaCount = metaKeys.length; if (metaKeys != null) for(int j=0;j<metaCount;j++) { metaoffsets.put(metaKeys[j], j); } final int size = rs.getResultSize(); final int[] docids = rs.getDocids(); final double[] scores = rs.getScores(); final short[] occ = rs.getOccurrences(); final String[][] meta = rs.allMetaItems(); for(int i=0;i<size;i++) { String[] metaValues = new String[metaCount]; for(int j=0;j<metaCount;j++) metaValues[j] = meta[j][i]; rtr.add(new ScoredDoc(docids[i], scores[i], occ[i], metaValues, metaoffsets)); } return rtr; }
public ScoredDocList getResults() { ResultSet rs = this.getResultSet(); if (rs == null) throw new IllegalStateException("No resultset found"); final String[] metaKeys = rs.getMetaKeys(); Results rtr = new Results(metaKeys); Map<String,Integer> metaoffsets = new HashMap<>(); final int metaCount = metaKeys.length; if (metaKeys != null) for(int j=0;j<metaCount;j++) { metaoffsets.put(metaKeys[j], j); } final int size = rs.getResultSize(); final int[] docids = rs.getDocids(); final double[] scores = rs.getScores(); final short[] occ = rs.getOccurrences(); final String[][] meta = rs.allMetaItems(); for(int i=0;i<size;i++) { String[] metaValues = new String[metaCount]; for(int j=0;j<metaCount;j++) metaValues[j] = meta[j][i]; rtr.add(new ScoredDoc(docids[i], scores[i], occ[i], metaValues, metaoffsets)); } return rtr; }