Search in sources :

Example 1 with SolrTestCaseJ4

use of org.apache.solr.SolrTestCaseJ4 in project lucene-solr by apache.

the class MockSolrEntityProcessor method getDocs.

private SolrDocumentList getDocs(int start, int rows) {
    SolrDocumentList docs = new SolrDocumentList();
    docs.setNumFound(docsData.size());
    docs.setStart(start);
    int endIndex = start + rows;
    int end = docsData.size() < endIndex ? docsData.size() : endIndex;
    for (int i = start; i < end; i++) {
        SolrDocument doc = new SolrDocument();
        SolrTestCaseJ4.Doc testDoc = docsData.get(i);
        doc.addField("id", testDoc.id);
        doc.addField("description", testDoc.getValues("description"));
        docs.add(doc);
    }
    return docs;
}
Also used : SolrDocument(org.apache.solr.common.SolrDocument) SolrDocumentList(org.apache.solr.common.SolrDocumentList) SolrTestCaseJ4(org.apache.solr.SolrTestCaseJ4)

Aggregations

SolrTestCaseJ4 (org.apache.solr.SolrTestCaseJ4)1 SolrDocument (org.apache.solr.common.SolrDocument)1 SolrDocumentList (org.apache.solr.common.SolrDocumentList)1