索引csv文件时Solr核心架构更改

时间:2018-07-11 06:39:18

标签: solr

我正在使用独立的solr。

使用solr 7.4.0

  • 启动solr-> solr启动。

  • 创建的solr核心-> solr核心-c solutionData

  • 发布了核心解决方案的架构 http://localhost:8983/solr/solutionData/schema

{
  "add-field" : {
      "name" : "solutiondataid",
      "type" : "pint"
  },
  "add-field" : {
      "name" : "client",
      "type" : "string"
  },
  "add-field" : {
      "name" : "goal",
      "type" : "string"
  },
  "add-field" : {
      "name" : "comment",
      "type" : "string"
  },
  "add-field" : {
      "name" : "description",
      "type" : "string"
  },
  "add-field" : {
      "name" : "fmaengid",
      "type" : "pint"
  }
}
  • 现在,如果我使用以下方法检查架构: GET http://localhost:8983/solr/solutionData/schema/fields 我收到以下json响应:
{
  "responseHeader":{
    "status":0,
    "QTime":0},
  "fields":[{
      "name":"_root_",
      "type":"string",
      "docValues":false,
      "indexed":true,
      "stored":false},
    {
      "name":"_text_",
      "type":"text_general",
      "multiValued":true,
      "indexed":true,
      "stored":false},
    {
      "name":"_version_",
      "type":"plong",
      "indexed":false,
      "stored":false},
    {
      "name":"client",
      "type":"string"},
    {
      "name":"comment",
      "type":"string"},
    {
      "name":"description",
      "type":"string"},
    {
      "name":"fmaengid",
      "type":"pint"},
    {
      "name":"goal",
      "type":"string"},
    {
      "name":"id",
      "type":"string",
      "multiValued":false,
      "indexed":true,
      "required":true,
      "stored":true},
    {
      "name":"solutiondataid",
      "type":"pint"}]}
  • 现在,我将一个csv文件中的数据索引到核心中。该csv文件具有与架构中指定的相同的字段名称。

  • 再次,我如上所述使用架构API。我得到以下json:

{
  "responseHeader":{
    "status":0,
    "QTime":0},
  "fields":[{
      "name":"_root_",
      "type":"string",
      "docValues":false,
      "indexed":true,
      "stored":false},
    {
      "name":"_solutiondataid",
      "type":"plongs"},
    {
      "name":"_text_",
      "type":"text_general",
      "multiValued":true,
      "indexed":true,
      "stored":false},
    {
      "name":"_version_",
      "type":"plong",
      "indexed":false,
      "stored":false},
    {
      "name":"client",
      "type":"string"},
    {
      "name":"comment",
      "type":"string"},
    {
      "name":"description",
      "type":"string"},
    {
      "name":"fmaengid",
      "type":"pint"},
    {
      "name":"goal",
      "type":"string"},
    {
      "name":"id",
      "type":"string",
      "multiValued":false,
      "indexed":true,
      "required":true,
      "stored":true},
    {
      "name":"solutiondataid",
      "type":"pint"}]}

大家都可以看到,新字段已添加到架构中,即“ _solutiondataid” 谁能回答这个问题?

0 个答案:

没有答案