Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12502

Unify and reduce the number of SolrClient#add methods

    XMLWordPrintableJSON

    Details

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

      Description

      On SOLR-11654 we noticed that SolrClient#add has 10 overloaded methods which can be very confusing to new users.

      Also the UpdateRequest class is public so that means if a user is looking for a custom combination they can always choose to do so by writing a couple of lines of code.

      For 8.0 which might not be very far away we can improve this situation

       

      Quoting David from SOLR-11654

      Any way I guess we'll leave SolrClient alone.  Thanks for your input Varun.  Yes it's a shame there are so many darned overloaded methods... I think it's a large part due to the optional "collection" parameter which like doubles the methods!  I've been bitten several times writing SolrJ code that doesn't use the right overloaded version (forgot to specify collection).  I think for 8.0, either all SolrClient methods without "collection" can be removed in favor of insisting you use the overloaded variant accepting a collection, or SolrClient itself could be locked down to one collection at the time you create it or have a CollectionSolrClient interface retrieved from a SolrClient.withCollection(collection) in which all the operations that require a SolrClient are on that interface and not SolrClient proper.  Several ideas to consider.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              varunthacker Varun Thacker
            • Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: