Solr
  1. Solr
  2. SOLR-2675

Support core properties when creating cores via REST API (CoreAdminHandler)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: multicore
    • Labels:
      None

      Description

      When crating cores through solr.xml, I am able to specify custom
      properties, to be referenced in solrconfig.xml. For example:

      <cores adminPath="/admin/cores" defaultCoreName="master">
      <core name="master" instanceDir="core1" shard="shard1" collection="myconf" >
      <property name="enable.master" value="true" />
      </core>
      <core name="slave" instanceDir="core2" shard="shard2" collection="myconf">
      <property name="enable.slave" value="true" />
      <property name="masterHost" value="node2:8983" />
      </core>
      </cores>

      There does not seem a way to specify such properties when creating cores through the CoreAdminHandler request.

      CoreAdminHandler#handleCreateAction always calls dcore.setCoreProperties(null);

      1. coreadmin.patch
        2 kB
        Yury Kats
      2. SOLR-2675.patch
        7 kB
        Hoss Man

        Activity

        Hide
        Yury Kats added a comment -

        Patch against the trunk.

        CoreAdminHandler#handleCreateAction looks at request parameters in format property.name=value and uses them as name=value properties when creating a core.

        Show
        Yury Kats added a comment - Patch against the trunk. CoreAdminHandler#handleCreateAction looks at request parameters in format property.name=value and uses them as name=value properties when creating a core.
        Hide
        Hoss Man added a comment -

        Yury: your patch looks good to me, here's an updated version that adds a test so we can verify that it works (and that we won't break it in the future)

        Show
        Hoss Man added a comment - Yury: your patch looks good to me, here's an updated version that adds a test so we can verify that it works (and that we won't break it in the future)
        Hide
        Hoss Man added a comment -

        I'll get this in to trunk in a few days unless anyone objects.

        then i'll try to backport to 3x as well assuming it goes cleanly.

        Show
        Hoss Man added a comment - I'll get this in to trunk in a few days unless anyone objects. then i'll try to backport to 3x as well assuming it goes cleanly.
        Hide
        Hoss Man added a comment -

        Committed revision 1159418. - trunk
        Committed revision 1159428. - 3x

        ...for some reason, when backporting the test to 3x i had to change cores.getCore("collection1"); to cores.getCore(""); ... not really sure why.

        Leaving the issue open so we make sure to document this – Yury, would
        you like to take a crack at updating the wiki?

        https://wiki.apache.org/solr/CoreAdmin#CREATE

        Show
        Hoss Man added a comment - Committed revision 1159418. - trunk Committed revision 1159428. - 3x ...for some reason, when backporting the test to 3x i had to change cores.getCore("collection1"); to cores.getCore(""); ... not really sure why. Leaving the issue open so we make sure to document this – Yury, would you like to take a crack at updating the wiki? https://wiki.apache.org/solr/CoreAdmin#CREATE
        Hide
        Yury Kats added a comment -

        Sorry, for the delay, just back from internet-free vacation.
        Thanks for accepting the patch! I'll update the wiki.

        Show
        Yury Kats added a comment - Sorry, for the delay, just back from internet-free vacation. Thanks for accepting the patch! I'll update the wiki.
        Hide
        Yury Kats added a comment -

        Wiki updated.

        Show
        Yury Kats added a comment - Wiki updated.
        Hide
        Hoss Man added a comment -

        Thanks Yury!

        Show
        Hoss Man added a comment - Thanks Yury!
        Hide
        Robert Muir added a comment -

        bulk close for 3.4

        Show
        Robert Muir added a comment - bulk close for 3.4

          People

          • Assignee:
            Hoss Man
            Reporter:
            Yury Kats
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development