throw new RuntimeException( "shoudl be doc! "+parser.getLocalName() + " :: " + parser.getLocation() ); docs.add( readDocument( parser ) );
throw new RuntimeException( "should be doc! "+parser.getLocalName() + " :: " + parser.getLocation() ); docs.add( readDocument( parser ) );
throw new RuntimeException( "should be doc! "+parser.getLocalName() + " :: " + parser.getLocation() ); docs.add( readDocument( parser ) );
private void append(SolrDocumentList results, ScoreDoc[] more, Set<Integer> alreadyFound, Map<String,SchemaField> fields, Map<String,Object> extraFields, float scoreCutoff, IndexReader reader, boolean includeScore) throws IOException { for (ScoreDoc hit : more) { if (alreadyFound.contains(hit.doc)) { continue; } Document doc = reader.document(hit.doc); SolrDocument sdoc = new SolrDocument(); for (String fieldname : fields.keySet()) { SchemaField sf = fields.get(fieldname); if (sf.stored()) { sdoc.addField(fieldname, doc.get(fieldname)); } } for (String extraField : extraFields.keySet()) { sdoc.addField(extraField, extraFields.get(extraField)); } if (includeScore) { sdoc.addField("score", hit.score); } results.add(sdoc); alreadyFound.add(hit.doc); } } public class PairComparable implements Comparator<Pair> {
private void append(SolrDocumentList results, ScoreDoc[] more, Set<Integer> alreadyFound, Map<String,SchemaField> fields, Map<String,Object> extraFields, float scoreCutoff, IndexReader reader, boolean includeScore) throws IOException { for (ScoreDoc hit : more) { if (alreadyFound.contains(hit.doc)) { continue; } Document doc = reader.document(hit.doc); SolrDocument sdoc = new SolrDocument(); for (String fieldname : fields.keySet()) { SchemaField sf = fields.get(fieldname); if (sf.stored()) { sdoc.addField(fieldname, doc.get(fieldname)); } } for (String extraField : extraFields.keySet()) { sdoc.addField(extraField, extraFields.get(extraField)); } if (includeScore) { sdoc.addField("score", hit.score); } results.add(sdoc); alreadyFound.add(hit.doc); } } public class PairComparable implements Comparator<Pair> {
SolrDocumentList groupList = g.getResult(); list.add(groupList.get(0));
results.add(doc);
@Override public SolrDocumentList getResults() { SolrDocumentList results = new SolrDocumentList(); for (int i = 0; i < 1000; i++) { results.add(new SolrDocument()); } results.setNumFound(1000); counter++; return results; }
documentList.add(solrDocument);
public static GetResult buildRealTimeGetResult(QueryResponse response, RealTimeGet query, DocumentFactory factory) { final String DOC = "doc"; long nResults = 0; List<Document> docResults = new ArrayList<>(); final SolrDocumentList results = response.getResults(); if(results != null && results.size() >0){ docResults = buildResultList(results, null, factory, null); nResults = docResults.size(); } else { final SolrDocument solrDoc = (SolrDocument)response.getResponse().get(DOC); if(solrDoc != null) { final SolrDocumentList solrDocuments = new SolrDocumentList(); solrDocuments.add(solrDoc); docResults = buildResultList(solrDocuments, null, factory, null); nResults = 1; } } return new GetResult(nResults,docResults,query,factory,response.getQTime()).setElapsedTime(response.getElapsedTime()); }
private static ResponseFormatDocs getResponseFormatDocs(final SolrQueryResponse rsp) { SolrDocumentList docList = (SolrDocumentList)rsp.getValues().get("response"); SolrDocument singleDoc = (SolrDocument)rsp.getValues().get("doc"); if (docList == null && singleDoc == null) { return null; // no documents to filter } if (docList != null && singleDoc != null) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Not able to filter secure reponse, RealTimeGet returned both a doc list and " + "an individual document"); } final boolean useResponseField = docList != null; if (docList == null) { docList = new SolrDocumentList(); docList.add(singleDoc); } return new ResponseFormatDocs(useResponseField, docList); }
list.add(new SolrDocument(m));
solrDocumentList.add(doc); solrDocumentList.add(doc); maxScore = maxScore < searchDoc.getScore() ? searchDoc.getScore() : maxScore; cnt++; for (CmsSearchResource r : resourceDocumentList) { maxScore = maxScore < r.getDocument().getScore() ? r.getDocument().getScore() : maxScore; solrDocumentList.add(((CmsSolrDocument)r.getDocument()).getSolrDocument());
responseDocs.setStart(ss.getOffset()); for (int i=0; i<resultSize; i++) responseDocs.add(null);
list.add( doc );
solrDocumentList.add(doc);
transformer.transform(newDoc, docid); docListToReturn.add(newDoc);