You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Andrew Nagy (JIRA)" <ji...@apache.org> on 2008/04/01 00:28:24 UTC

[jira] Created: (SOLR-523) Solr Schema - version number requirements

Solr Schema - version number requirements
-----------------------------------------

                 Key: SOLR-523
                 URL: https://issues.apache.org/jira/browse/SOLR-523
             Project: Solr
          Issue Type: Bug
    Affects Versions: 1.2
            Reporter: Andrew Nagy
            Priority: Minor


When I change the version number of the solr schema from 1.0 or 1.1 to something arbitrary like say 0.8.1 - solr reports a parsing error with the schema - however, a version number "0.8" is accepted.  It would be nice if solr reporting an "invalid schema version" error instead or atleast put something in the log that has a bit more detail.

You could add in a check in src/java/org/apache/solr/schema/IndexSchema.java that might look like this:

    Node node = (Node) xpath.evaluate("/schema/@version", document, XPathConstants.NODE);
    if (!("1.0".equals(node) || "1.1".equals(node))) {
        log.warning("invalid schema version - use 1.0 or 1.1 only");
    }

It's quite poor to hardcode the version numbers - but I thought I should include something to give you a more concrete idea of what I am talking about.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-523) Solr Schema - version number requirements

Posted by "Andrew Nagy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Nagy updated SOLR-523:
-----------------------------

    Fix Version/s: 1.4

Assigning this to 1.4 as to not effect the release of 1.3

> Solr Schema - version number requirements
> -----------------------------------------
>
>                 Key: SOLR-523
>                 URL: https://issues.apache.org/jira/browse/SOLR-523
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: Andrew Nagy
>            Priority: Minor
>             Fix For: 1.4
>
>
> When I change the version number of the solr schema from 1.0 or 1.1 to something arbitrary like say 0.8.1 - solr reports a parsing error with the schema - however, a version number "0.8" is accepted.  It would be nice if solr reporting an "invalid schema version" error instead or atleast put something in the log that has a bit more detail.
> You could add in a check in src/java/org/apache/solr/schema/IndexSchema.java that might look like this:
>     Node node = (Node) xpath.evaluate("/schema/@version", document, XPathConstants.NODE);
>     if (!("1.0".equals(node) || "1.1".equals(node))) {
>         log.warning("invalid schema version - use 1.0 or 1.1 only");
>     }
> It's quite poor to hardcode the version numbers - but I thought I should include something to give you a more concrete idea of what I am talking about.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-523) Solr Schema - version number requirements

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583925#action_12583925 ] 

Hoss Man commented on SOLR-523:
-------------------------------

schema version numbers really are specific and meaningful, just like Lucene index format version number, so having a hardcoded set of legal version numbers and warning if an unrecognized schema version is found makes sense to me.

> Solr Schema - version number requirements
> -----------------------------------------
>
>                 Key: SOLR-523
>                 URL: https://issues.apache.org/jira/browse/SOLR-523
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: Andrew Nagy
>            Priority: Minor
>
> When I change the version number of the solr schema from 1.0 or 1.1 to something arbitrary like say 0.8.1 - solr reports a parsing error with the schema - however, a version number "0.8" is accepted.  It would be nice if solr reporting an "invalid schema version" error instead or atleast put something in the log that has a bit more detail.
> You could add in a check in src/java/org/apache/solr/schema/IndexSchema.java that might look like this:
>     Node node = (Node) xpath.evaluate("/schema/@version", document, XPathConstants.NODE);
>     if (!("1.0".equals(node) || "1.1".equals(node))) {
>         log.warning("invalid schema version - use 1.0 or 1.1 only");
>     }
> It's quite poor to hardcode the version numbers - but I thought I should include something to give you a more concrete idea of what I am talking about.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.