blevesearch / bleve

A modern text/numeric/geo-spatial/vector indexing library for go
Apache License 2.0
10k stars 678 forks source link

Failed to install with zap error #1373

Open dzpt opened 4 years ago

dzpt commented 4 years ago

go version go1.12.6 darwin/amd64

go get github.com/blevesearch/bleve/...
package github.com/blevesearch/bleve
        imports github.com/blevesearch/zap/v11: cannot find package "github.com/blevesearch/zap/v11" in any of:
        /usr/local/go/src/github.com/blevesearch/zap/v11 (from $GOROOT)
        /*/go/src/github.com/blevesearch/zap/v11 (from $GOPATH)

Couldn't find zap folder ?

mschoch commented 4 years ago

Bleve now either requires using Go modules (which can find the v11 version of zap) or requires you to use some other tool to properly lay out your GOPATH. Using go get without Go modules is no longer supported.

Please see: https://github.com/blevesearch/bleve/issues/1350

nebuxadnezzar commented 3 years ago

So how exactly it can be done? I am new to Golang, I have no idea how to use go modules. Please give concise instruction rather than RTFM.

mschoch commented 3 years ago

I don't think there is anything to be done. The command you ran is not typically needed. What are you trying to do?

nebuxadnezzar commented 3 years ago

I am trying to install bleve code so that i can use it in my indexer project. I am using go get github.com/blevesearch/bleve command. Nothing exotic here.

On Tue, May 18, 2021, 21:32 Marty Schoch @.***> wrote:

I don't think there is anything to be done. The command you ran is not typically needed. What are you trying to do?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blevesearch/bleve/issues/1373#issuecomment-843677587, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIV5VSBG7LVOZBJAIHTU6S3TOMIKTANCNFSM4MKXRMNA .

mschoch commented 3 years ago

Here is an example of how I can create a new program from scratch that uses bleve:

$ go version
go version go1.16.4 linux/amd64
$ mkdir -p /tmp/bleve-indexer
$ cd /tmp/bleve-indexer
$  ls -l
total 0
$  go mod init github.com/mschoch/bleve-indexer
go: creating new go.mod: module github.com/mschoch/bleve-indexer
$  cat go.mod
module github.com/mschoch/bleve-indexer

go 1.16
$  vi main.go

Copy/Paste this content to main.go:

package main

import(
    "log"

    "github.com/blevesearch/bleve/v2"
)

func main() {
    _ = bleve.NewIndexMapping()
    log.Println("build index mapping")
}

Then continue:

$  go build
main.go:6:2: no required module provides package github.com/blevesearch/bleve/v2; to add it:
    go get github.com/blevesearch/bleve/v2
$  go get github.com/blevesearch/bleve/v2
go get: added github.com/blevesearch/bleve/v2 v2.0.3
$  ls -l
total 20
-rw-rw-r-- 1 mschoch mschoch  109 May 19 10:03 go.mod
-rw-rw-r-- 1 mschoch mschoch 9995 May 19 10:03 go.sum
-rw-rw-r-- 1 mschoch mschoch  150 May 19 10:03 main.go
$  go build  
$  ls -l
total 11664
-rwxrwxr-x 1 mschoch mschoch 11923305 May 19 10:04 bleve-indexer
-rw-rw-r-- 1 mschoch mschoch      109 May 19 10:03 go.mod
-rw-rw-r-- 1 mschoch mschoch     9995 May 19 10:03 go.sum
-rw-rw-r-- 1 mschoch mschoch      149 May 19 10:04 main.go
$  ./bleve-indexer
2021/05/19 10:04:12 build index mapping

Now, this program doesn't do much useful work, but it does build and uses the bleve package. You should be able to build on from here.