bleve: Index | Files | Directories

package cmd

import ""


Package Files

bulk.go check.go count.go create.go dictionary.go dump.go dumpDoc.go dumpFields.go fields.go index.go mapping.go query.go registry.go root.go scorch.go zap.go


var DefaultOpenReadOnly = false

DefaultOpenReadOnly allows some distributions of this command to default to always opening the index read-only

var RootCmd = &cobra.Command{
    Use:   "bleve",
    Short: "command-line tool to interact with a bleve index",
    Long:  `Bleve is a command-line tool to interact with a bleve index.`,
    PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
        if len(args) < 1 {
            return fmt.Errorf("must specify path to index")
        runtimeConfig := map[string]interface{}{
            "read_only": DefaultOpenReadOnly,
        var err error
        idx, err = bleve.OpenUsing(args[0], runtimeConfig)
        if err != nil {
            return fmt.Errorf("error opening bleve index: %v", err)
        return nil
    PersistentPostRunE: func(cmd *cobra.Command, args []string) error {
        err := idx.Close()
        if err != nil {
            return fmt.Errorf("error closing bleve index: %v", err)
        return nil

RootCmd represents the base command when called without any subcommands

func CanMutateBleveIndex Uses

func CanMutateBleveIndex(c *cobra.Command) bool

CanMutateBleveIndex returns true if the command is capable of mutating the bleve index, or false if its operation is read-only

func Execute Uses

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.



Package cmd imports 19 packages (graph) and is imported by 1 packages. Updated 2019-03-21. Refresh now. Tools for package owners.