You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ct...@apache.org on 2016/12/09 15:58:56 UTC

[2/4] lucene-solr:apiv2: SOLR-8029: Modify schemaEdit specs; add include file for analyzers

SOLR-8029: Modify schemaEdit specs; add include file for analyzers


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cedc63d4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cedc63d4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cedc63d4

Branch: refs/heads/apiv2
Commit: cedc63d46e5aca384b8b34fbe7c51568ffbe671a
Parents: bf89a7a
Author: Cassandra Targett <ct...@apache.org>
Authored: Thu Dec 8 15:34:51 2016 -0600
Committer: Cassandra Targett <ct...@apache.org>
Committed: Thu Dec 8 15:34:51 2016 -0600

----------------------------------------------------------------------
 .../apispec/core.SchemaEdit.addField.json       | 71 ++++++++++++++------
 .../core.SchemaEdit.addFieldType.analyzers.json | 39 +++++++++++
 .../apispec/core.SchemaEdit.addFieldType.json   | 39 ++++++-----
 .../src/resources/apispec/core.SchemaEdit.json  |  1 +
 4 files changed, 112 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cedc63d4/solr/core/src/resources/apispec/core.SchemaEdit.addField.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/core.SchemaEdit.addField.json b/solr/core/src/resources/apispec/core.SchemaEdit.addField.json
index 798b81b..d4a6996 100644
--- a/solr/core/src/resources/apispec/core.SchemaEdit.addField.json
+++ b/solr/core/src/resources/apispec/core.SchemaEdit.addField.json
@@ -3,65 +3,96 @@
   "type":"object",
   "properties":{
     "name": {
-      "type": "string"
+      "type": "string",
+      "description": "The name of the field. Names should be alphanumeric or underscore characters only, and not start with a digit. Names also cannot begin and end with an underscore, as such field names are reserved by the system."
     },
     "type": {
-      "type": "string"
+      "type": "string",
+      "description":"The name of the fieldType for this field."
     },
     "defaultValue": {
-      "type": "string"
+      "type": "string",
+      "description": "An optional default value that should be added automatically to any document that does not have a value for this field."
     },
     "indexed": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, the field will be indexed and will be available for use in queries to retrieve matching documents. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true.",
+      "default": "true"
     },
     "stored": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, the actual value of the field can be retrieved by queries and be displayed in results. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true.",
+      "default":"true"
     },
     "omitNorms": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, length normalization and index-time boosting for a field are omitted from the index. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true for all primitive field types (such as dates, strings, boolean, and numeric fields), but will default to false for non-primitive field types."
     },
     "omitTermFreqAndPositions": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, all term frequency, positions, and payloads will not be indexed. This means that phrase queries, proximity queries and similar queries that rely on analysis of the frequency of a query term or the position of a term to other terms will not be supported. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true for all field types that are not text fields."
     },
     "termVectors": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, term vectors will be stored to be able to compute similarity between two documents. This is required to use More Like This. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false. Do not enable this if using the PostingsHighlighter.",
+      "default": "false"
     },
     "termPositions": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, term positions will be stored for use with highlighting. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false. Do not enable this if using the PostingsHighlighter.",
+      "default": "false"
     },
     "termOffsets": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, term offsets will be stored for use with highlighting. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false. Do not enable this if using the PostingsHighlighter.",
+      "default": "false"
     },
     "multiValued": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, a single document can have multiple values in a single field, and these values will be indexed. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false.",
+      "default": "false"
     },
     "sortMissingFirst": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, when sorting by the field, any documents missing a value for the field will be placed at the top of the list. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false. If sortMissingFirst and sortMissingLast are both false, documents missing this field will be placed at the top when sorting in ascending order (asc) or at the bottom when sorting in descending order (desc).",
+      "default": "false"
     },
     "sortMissingLast": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, when sorting by the field, any documents missing a value for the field will be placed at the bottom of the list. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false. If sortMissingFirst and sortMissingLast are both false, documents missing this field will be placed at the top when sorting in ascending order (asc) or at the bottom when sorting in descending order (desc).",
+      "default": "false"
     },
     "required": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, any document that does not have a value for the field will be rejected. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false.",
+      "default": "false"
     },
     "omitPositions": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, information about the position of terms in a document will not be stored in the index, which means phrase queries, proximity queries, and similar will not be supported for this field. It is similar to 'omitTermFreqAndPositions', but 'omitPositions' will allow term frequency information to be stored. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true for all field types that are not text fields."
     },
     "storeOffsetsWithPositions": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, term offsets will be stored with positions in the postings list in the index. This is required if using the PostingsHighlighter. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false.",
+      "default": "false"
     },
     "docValues": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, field values will be stored in a column-oriented docValues structure. This can be more efficient for some fields, particularly those used for faceting. More information is available from https://cwiki.apache.org/confluence/display/solr/DocValues. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true for all non-text fields (such as dates, integers, longs, etc.)."
     },
     "termPayloads": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, term payloads will be stored for use with highlighting. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to false. Do not enable this if using the PostingsHighlighter.",
+      "default": "false"
     },
     "useDocValuesAsStored": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true and docValues are enabled for the field, the field will be returned when all fields are requested (using '*' with the fl parameter), even if it is not stored. If this is not defined, it will inherit the value from the fieldType. If the fieldType does not define a value, it will default to true.",
+      "default": "true"
     }
   },
   "required": [
     "name",
     "type"
   ]
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cedc63d4/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.analyzers.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.analyzers.json b/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.analyzers.json
new file mode 100644
index 0000000..c2e6acf
--- /dev/null
+++ b/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.analyzers.json
@@ -0,0 +1,39 @@
+"class": {
+  "type": "string"
+},
+"tokenizer":{
+  "type":"object",
+  "properties":{
+    "class":{
+      "type":"string"
+    }
+  },
+  "required":["class"],
+  "additionalProperties":true
+},
+"charFilters":{
+  "type":"array",
+  "items":{
+    "type":"object",
+    "properties":{
+      "class":{
+        "type":"string"
+      }
+    },
+    "required":["class"],
+    "additionalProperties":true
+  }
+},
+"filters":{
+  "type":"array",
+  "items":{
+    "type":"object",
+    "properties":{
+      "class":{
+        "type":"string"
+      }
+    },
+    "required":["class"],
+    "additionalProperties":true
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cedc63d4/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.json b/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.json
index 0ed22ac..ff6213e 100644
--- a/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.json
+++ b/solr/core/src/resources/apispec/core.SchemaEdit.addFieldType.json
@@ -2,43 +2,45 @@
   "type":"object",
   "properties": {
     "name": {
-      "type": "string"
+      "type": "string",
+      "description": "The name of the field type. This name is used when defining a field. It is strongly recommended that field type names consist only of alphanumeric or underscore characters and not start with a digit."
     },
     "class": {
-      "type": "string"
+      "type": "string",
+      "description": "The class name to use for the field type. Class names do not need to be fully qualified if they are included with Solr, so instead of 'org.apache.solr.schema.TextField', you can abbreviate the name as 'solr.TextField'. Custom or third-party class names may need to be fully qualified, however."
     },
     "positionIncrementGap": {
-      "type": "number"
+      "type": "number",
+      "description": "The distance between the values of a multivalued field. This is used to prevent inaccurate phrase matches across two separate values of the same field.",
+      "default": "0"
     },
     "autoGeneratePhraseQueries": {
-      "type": "boolean"
+      "type": "boolean",
+      "description": "If true, phrase queries will automatically be generated for adjacent terms. If false, terms must also be enclosed in double-quotes to be treated as phrases.",
+      "default": "false"
     },
     "docValuesFormat": {
-      "type": "string"
+      "type": "string",
+      "description": "Defines a custom DocValuesFormat to use for fields of this type. A custom DocValuesFormat requires that a schema-aware codec has also been configured in solrconfig.xml."
     },
     "postingsFormat": {
-      "type": "string"
+      "type": "string",
+      "description": "Defines a custom PostingsFormat to use for fields of this type. A custom PostingsFormat requires that a schema-aware codec has also been configured in solrconfig.xml."
     },
     "queryAnalyzer": {
       "type": "object",
-      "properties": {
-        "tokenizer": {
-          "type": "object",
-          "properties": {
-            "class": {
-              "type": "string"
-            }
-          },
-          "additionalProperties": true
-        }
-      },
+      "description": "A query analyzer section defines how incoming queries to Solr will be analyzed for a field of this type.",
+      "properties":
+         {"#include":"core.SchemaEdit.addFieldType.analyzers.json"},
       "additionalProperties": true
     },
     "indexAnalyzer": {
       "type": "object",
+      "description": "An index analyzer section defines how incoming text in documents will be analyzed for a field of this type.",
       "properties": {
         "tokenizer": {
           "type": "object",
+          "description": "",
           "properties": {
             "class": {
               "type": "string"
@@ -51,6 +53,7 @@
     },
     "analyzer": {
       "type": "object",
+      "description": "An analyzer defines how both incoming text in documents and queries are analyzed for a field of this type. If a query analyzer and an index analyzer have both been defined, a general analyzer does not need to be defined for this type.",
       "properties": {
         "class": {
           "type": "string"
@@ -100,4 +103,4 @@
     "name",
     "class"
   ]
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cedc63d4/solr/core/src/resources/apispec/core.SchemaEdit.json
----------------------------------------------------------------------
diff --git a/solr/core/src/resources/apispec/core.SchemaEdit.json b/solr/core/src/resources/apispec/core.SchemaEdit.json
index 682884f..bbf4082 100644
--- a/solr/core/src/resources/apispec/core.SchemaEdit.json
+++ b/solr/core/src/resources/apispec/core.SchemaEdit.json
@@ -1,5 +1,6 @@
 {
   "documentation": "https://cwiki.apache.org/confluence/display/solr/Schema+API",
+  "description": "The Schema API provides viewing, editing, adding, and deleting elements of Solr's schema. This API can only be used if Managed Schema is enabled and the schema is defined as mutable. See https://cwiki.apache.org/confluence/display/solr/Schema+Factory+Definition+in+SolrConfig for more information about enabling Managed Schema.",
   "methods": [
     "POST"
   ],