Example usage for org.apache.solr.client.solrj SolrClient getById

List of usage examples for org.apache.solr.client.solrj SolrClient getById

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj SolrClient getById.

Prototype

public SolrDocumentList getById(Collection<String> ids) throws SolrServerException, IOException 

Source Link

Document

Retrieves the SolrDocuments associated with the given identifiers.

Usage

From source file:org.phenotips.variantstore.db.solr.SolrVariantUtils.java

License:Open Source License

/**
 * Retrieve a metadocument that stores all individual ids.
 *
 * @param server the solr server to assist communication with a Solr server
 *
 * @return a SolrDocument/* w w w .ja  v  a2  s  .  c  om*/
 * @throws SolrServerException SolrServerException
 * @throws IOException IOException
 */
public static SolrDocument getMetaDocument(SolrClient server) throws SolrServerException, IOException {
    SolrDocument metaDoc = server.getById(METADATA_DOC_ID);
    if (metaDoc == null) {
        metaDoc = new SolrDocument();
        metaDoc.setField(VariantsSchema.ID, METADATA_DOC_ID);
        metaDoc.setField(VariantsSchema.CALLSET_IDS, Collections.emptyList());
    }
    return metaDoc;
}