Solr
  1. Solr
  2. SOLR-6655

Improve SimplePostTool to easily specify target port/collection etc.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None

      Description

      Right now, the SimplePostTool has a single parameter 'url' that can be used to send the request to a specific endpoint. It would make sense to allow users to specify just the collection name, port etc. explicitly and independently as separate parameters.

      1. SOLR-6655.patch
        2 kB
        Erik Hatcher

        Activity

        Hide
        Erik Hatcher added a comment - - edited

        The default url could be a pattern of

        "http://${host}:${port}/solr/${collection}/update"

        where host defaults to localhost, port to 8983, and collection to collection1. And the command-line could take -c <collection> to override just that piece, for example.

        Show
        Erik Hatcher added a comment - - edited The default url could be a pattern of "http: //${host}:${port}/solr/${collection}/update" where host defaults to localhost, port to 8983, and collection to collection1. And the command-line could take -c <collection> to override just that piece, for example.
        Hide
        Erik Hatcher added a comment -

        something like this patch, maybe? I used -c here to be ambiguous whether it's a "core" or a "collection".

        I imagine that ultimately we'll wrap this with a bin/ script invoker, in which case this may not be that relevant (as the script could construct the -Durl parameter).

        Show
        Erik Hatcher added a comment - something like this patch, maybe? I used -c here to be ambiguous whether it's a "core" or a "collection". I imagine that ultimately we'll wrap this with a bin/ script invoker, in which case this may not be that relevant (as the script could construct the -Durl parameter).
        Hide
        Anshum Gupta added a comment -

        How about letting the endpoint creation happen in the tool ? We might make it zk aware etc (if/when...).

        Show
        Anshum Gupta added a comment - How about letting the endpoint creation happen in the tool ? We might make it zk aware etc (if/when...).
        Hide
        Jan Høydahl added a comment -

        Remember that the guiding principle behind simple post tool is that it shall have NO dependencies on non-JDK libs, but be a 100% self contained java file.

        Perhaps it's time to create a SolrPostTool from scratch using SolrJ, ZK, proper commons-cli argument parsing, depend on some open source crawler library etc, and thus create a robust cmdline tool for pushing data to Solr.

        Show
        Jan Høydahl added a comment - Remember that the guiding principle behind simple post tool is that it shall have NO dependencies on non-JDK libs, but be a 100% self contained java file. Perhaps it's time to create a SolrPostTool from scratch using SolrJ, ZK, proper commons-cli argument parsing, depend on some open source crawler library etc, and thus create a robust cmdline tool for pushing data to Solr.
        Hide
        Anshum Gupta added a comment -

        Sure! Just that, it'd be another issue. SimplePostTool however should accept independent params to really make it simple.
        Collection, port, core to begin with.

        If we intend to use a common param '-c' for both, the collection and core, we should document it to avoid ambiguity there. I did open an issue (SOLR-6379) on a similar note but it's still open due to lack of consensus. I wouldn't want the same ambiguity to be dragged on to other parts of Solr too.

        Show
        Anshum Gupta added a comment - Sure! Just that, it'd be another issue. SimplePostTool however should accept independent params to really make it simple . Collection, port, core to begin with. If we intend to use a common param '-c' for both, the collection and core, we should document it to avoid ambiguity there. I did open an issue ( SOLR-6379 ) on a similar note but it's still open due to lack of consensus. I wouldn't want the same ambiguity to be dragged on to other parts of Solr too.
        Hide
        Anshum Gupta added a comment -

        Actually ignore that comment. That's (resolving between collection/core) something orthogonal.
        The final URL would be the same and Solr needs to handle it(if it does).

        Show
        Anshum Gupta added a comment - Actually ignore that comment. That's (resolving between collection/core) something orthogonal. The final URL would be the same and Solr needs to handle it(if it does).
        Hide
        ASF subversion and git services added a comment -

        Commit 1634765 from Erik Hatcher in branch 'dev/trunk'
        [ https://svn.apache.org/r1634765 ]

        SOLR-6655: SimplePostTool now features -Dhost, -Dport, and -Dc (for core/collection) parameters

        Show
        ASF subversion and git services added a comment - Commit 1634765 from Erik Hatcher in branch 'dev/trunk' [ https://svn.apache.org/r1634765 ] SOLR-6655 : SimplePostTool now features -Dhost, -Dport, and -Dc (for core/collection) parameters
        Hide
        ASF subversion and git services added a comment -

        Commit 1634767 from Erik Hatcher in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1634767 ]

        SOLR-6655: SimplePostTool now features -Dhost, -Dport, and -Dc (for core/collection) parameters

        Show
        ASF subversion and git services added a comment - Commit 1634767 from Erik Hatcher in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1634767 ] SOLR-6655 : SimplePostTool now features -Dhost, -Dport, and -Dc (for core/collection) parameters
        Hide
        Anshum Gupta added a comment -

        ant precommit seems to be complaining from this commit.

        [forbidden-apis] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale]
        [forbidden-apis] in org.apache.solr.util.SimplePostTool (SimplePostTool.java:224)
        [forbidden-apis] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale]
        [forbidden-apis] in org.apache.solr.util.SimplePostTool (SimplePostTool.java:375)
        [forbidden-apis] Scanned 2261 (and 1561 related) class file(s) for forbidden API invocations (in 1.25s), 2 error(s).

        Show
        Anshum Gupta added a comment - ant precommit seems to be complaining from this commit. [forbidden-apis] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale] [forbidden-apis] in org.apache.solr.util.SimplePostTool (SimplePostTool.java:224) [forbidden-apis] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale] [forbidden-apis] in org.apache.solr.util.SimplePostTool (SimplePostTool.java:375) [forbidden-apis] Scanned 2261 (and 1561 related) class file(s) for forbidden API invocations (in 1.25s), 2 error(s).
        Hide
        ASF subversion and git services added a comment -

        Commit 1634830 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1634830 ]

        SOLR-6655: Use root locale in String.format

        Show
        ASF subversion and git services added a comment - Commit 1634830 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1634830 ] SOLR-6655 : Use root locale in String.format
        Hide
        ASF subversion and git services added a comment -

        Commit 1634831 from shalin@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1634831 ]

        SOLR-6655: Use root locale in String.format

        Show
        ASF subversion and git services added a comment - Commit 1634831 from shalin@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1634831 ] SOLR-6655 : Use root locale in String.format
        Hide
        ASF subversion and git services added a comment -

        Commit 1634912 from hossman@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1634912 ]

        SOLR-6655: fix forbidden API for real this time

        Show
        ASF subversion and git services added a comment - Commit 1634912 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1634912 ] SOLR-6655 : fix forbidden API for real this time
        Hide
        ASF subversion and git services added a comment -

        Commit 1634914 from hossman@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1634914 ]

        SOLR-6655: fix forbidden API for real this time (merge r1634912)

        Show
        ASF subversion and git services added a comment - Commit 1634914 from hossman@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1634914 ] SOLR-6655 : fix forbidden API for real this time (merge r1634912)
        Hide
        Alexandre Rafalovitch added a comment -

        Jan Høydahl: spring.io may have a good base for a full-featured client with spring.data.solr, spring.shell and a bunch of other modules one could pull in. Might be a little large though

        Show
        Alexandre Rafalovitch added a comment - Jan Høydahl : spring.io may have a good base for a full-featured client with spring.data.solr, spring.shell and a bunch of other modules one could pull in. Might be a little large though
        Hide
        Jan Høydahl added a comment -

        Yes, feel free to open a new JIRA for a full-fledged production-ready feeder client with propoer SolrJ and other dependencies...

        Show
        Jan Høydahl added a comment - Yes, feel free to open a new JIRA for a full-fledged production-ready feeder client with propoer SolrJ and other dependencies...
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Erik Hatcher
            Reporter:
            Anshum Gupta
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development