Uploaded image for project: 'ManifoldCF'
  1. ManifoldCF
  2. CONNECTORS-1081

Documentation: elasticsearch index creation.

    XMLWordPrintableJSON

Details

    Description

      Hi,

      this may be useful for the documentation.

      Here are some simple steps for creating an elasticsearch index.

      % curl -XPUT 'http://localhost:9200/manifoldcf'
      % curl -XPUT 'http://localhost:9200/manifoldcf/attachment/_mapping' -d '
      {
        "attachment" : {
          "_source" : {
            "excludes" : [ "file" ]
          },
          "properties": { 
            "allow_token_document" : { 
              "type" : "string" 
            },
            "allow_token_parent" : { 
              "type" : "string" 
            },
            "allow_token_share" : { 
              "type" : "string" 
            },
            "attributes" : {
              "type" : "string"
            },
            "createdOn" : {
              "type" : "string"
            },
            "deny_token_document" : {
              "type" : "string"
            },
            "deny_token_parent" : {
              "type" : "string"
            },
            "deny_token_share" : {
              "type" : "string"
            },
            "lastModified" : {
              "type" : "string"
            },
            "shareName" : {
              "type" : "string"
            },
            "file" : {
              "type" : "attachment",
              "path" : "full",
              "fields" : {
                "file" : {
                  "store" : true,
                  "term_vector" : "with_positions_offsets",
                  "type" : "string"
                }
              }
            }
          }
        }
      }'
      

      This creates an index called manifoldcf with a mapping named attachment which has some generic fields for access tokens and a field file which makes use of the elasticsearch attachment mapper plugin. It is configured for highlighting ("term_vector" : "with_positions_offsets").

      The following part is useful for not saving the source json on the index which reduces the index size significantly. Be aware that you shouldn't do this if you need to re-index data on the elasticsearch side or you want access to the whole document.

      "_source" : {
        "excludes" : [ "file" ]
      },
      

      Attachments

        Activity

          People

            kwright@metacarta.com Karl Wright
            jan0sch Jens Grassel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: