Class DocsStreamer

  • All Implemented Interfaces:

    public class DocsStreamer
    extends Object
    implements Iterator<org.apache.solr.common.SolrDocument>
    This streams SolrDocuments from a DocList and applies transformer
    • Constructor Detail

    • Method Detail

      • currentIndex

        public int currentIndex()
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<org.apache.solr.common.SolrDocument>
      • next

        public org.apache.solr.common.SolrDocument next()
        Specified by:
        next in interface Iterator<org.apache.solr.common.SolrDocument>
      • convertLuceneDocToSolrDoc

        public static org.apache.solr.common.SolrDocument convertLuceneDocToSolrDoc​(org.apache.lucene.document.Document doc,
                                                                                    IndexSchema schema)
        use the 3 arg version for better performance
        This method is less efficient then the 3 arg version because it may convert some fields that are not needed
        See Also:
      • convertLuceneDocToSolrDoc

        public static org.apache.solr.common.SolrDocument convertLuceneDocToSolrDoc​(org.apache.lucene.document.Document doc,
                                                                                    IndexSchema schema,
                                                                                    ReturnFields fields)
        Converts the specified Document into a SolrDocument.

        The use of ReturnFields can be important even when it was already used to retrieve the Document from SolrDocumentFetcher because the Document may have been cached with more fields then are desired.

        doc - Document to be converted, must not be null
        schema - IndexSchema containing the field/fieldType details for the index the Document came from, must not be null.
        fields - ReturnFields instance that can be use to limit the set of fields that will be converted, must not be null
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<org.apache.solr.common.SolrDocument>
      • getValue

        public static Object getValue​(SchemaField sf,
                                      org.apache.lucene.index.IndexableField f)