Solr
  1. Solr
  2. SOLR-1802

Make Solr work with IndexReaderFactory implementations that return MultiReader

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: search
    • Labels:
      None

      Description

      When an IndexReaderFactory returns an instance of MultiReader, various places in Solr try to call reader.directory() and reader.getVersion, which results an UnsupportedOperationException.

        Activity

        Hide
        Hoss Man added a comment -

        editing issue summary to reflect that this is an improvement, not a bug.

        It was noted when IndexReaderFactory was added that using custom factories was incompatible with a lot of Solr features precisely because of the assumption about reader.directory()...

        CHANGES.txt when the API was introduced...

        59. SOLR-243: Add configurable IndexReaderFactory so that alternate IndexReader implementations 
            can be specified via solrconfig.xml. Note that using a custom IndexReader may be incompatible
            with ReplicationHandler (see comments in SOLR-1366). This should be treated as an experimental feature.
            (Andrzej Bialecki, hossman, Mark Miller, John Wang)
        
        

        example solrconfig.xml (the only place the feature is advertised)...

          <!-- Use the following format to specify a custom IndexReaderFactory - allows for alternate
               IndexReader implementations.
        
               ** Experimental Feature **
               Please note - Using a custom IndexReaderFactory may prevent certain other features
               from working. The API to IndexReaderFactory may change without warning or may even
               be removed from future releases if the problems cannot be resolved.
        
               ** Features that may not work with custom IndexReaderFactory **
               The ReplicationHandler assumes a disk-resident index. Using a custom
               IndexReader implementation may cause incompatibility with ReplicationHandler and
               may cause replication to not work correctly. See SOLR-1366 for details.
        
          <indexReaderFactory name="IndexReaderFactory" class="package.class">
            Parameters as required by the implementation
          </indexReaderFactory >
        
        Show
        Hoss Man added a comment - editing issue summary to reflect that this is an improvement, not a bug. It was noted when IndexReaderFactory was added that using custom factories was incompatible with a lot of Solr features precisely because of the assumption about reader.directory()... CHANGES.txt when the API was introduced... 59. SOLR-243: Add configurable IndexReaderFactory so that alternate IndexReader implementations can be specified via solrconfig.xml. Note that using a custom IndexReader may be incompatible with ReplicationHandler (see comments in SOLR-1366). This should be treated as an experimental feature. (Andrzej Bialecki, hossman, Mark Miller, John Wang) example solrconfig.xml (the only place the feature is advertised)... <!-- Use the following format to specify a custom IndexReaderFactory - allows for alternate IndexReader implementations. ** Experimental Feature ** Please note - Using a custom IndexReaderFactory may prevent certain other features from working. The API to IndexReaderFactory may change without warning or may even be removed from future releases if the problems cannot be resolved. ** Features that may not work with custom IndexReaderFactory ** The ReplicationHandler assumes a disk-resident index. Using a custom IndexReader implementation may cause incompatibility with ReplicationHandler and may cause replication to not work correctly. See SOLR-1366 for details. <indexReaderFactory name= "IndexReaderFactory" class= " package .class" > Parameters as required by the implementation </indexReaderFactory >
        Hide
        John Wang added a comment -

        Thanks Chris for the info.

        Show
        John Wang added a comment - Thanks Chris for the info.
        Hide
        Mark Miller added a comment -

        Hey John,

        Depending on what you are trying to do, you may look at the work around that was used in SOLR-1366. Its not generic, but it may work for your use case.

        Show
        Mark Miller added a comment - Hey John, Depending on what you are trying to do, you may look at the work around that was used in SOLR-1366 . Its not generic, but it may work for your use case.
        Hide
        John Wang added a comment -

        Thanks Mark for the pointer!

        Show
        John Wang added a comment - Thanks Mark for the pointer!

          People

          • Assignee:
            Unassigned
            Reporter:
            John Wang
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development