olivere / elastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch

Home Page:https://olivere.github.io/elastic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic.go:1038 +0x215 github.com/olivere/elastic/v7.(*TermsQuery).Source(0x0)

qqxhb opened this issue · comments

commented

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

[ ] elastic.v7 (for Elasticsearch 7.x)

Please describe the expected behavior

Please describe the actual behavior

/usr/local/ftf_go/src/runtime/panic.go:1038 +0x215
github.com/olivere/elastic/v7.(*TermsQuery).Source(0x0)
	/opt/tiger/compile_path/pkg/mod/github.com/olivere/elastic/v7@v7.0.24/search_queries_terms.go:71 +0x82
github.com/olivere/elastic/v7.(*BoolQuery).Source(0xc0080dfb80)
	/opt/tiger/compile_path/pkg/mod/github.com/olivere/elastic/v7@v7.0.24/search_queries_bool.go:134 +0x1a8
github.com/olivere/elastic/v7.(*SearchSource).Source(0xc0087776c0)
	/opt/tiger/compile_path/pkg/mod/github.com/olivere/elastic/v7@v7.0.24/search_source.go:395 +0x272
github.com/olivere/elastic/v7.(*SearchService).Do(0xc009659470, {0x55fbec8, 0xc008d42a20})
	/opt/tiger/compile_path/pkg/mod/github.com/olivere/elastic/v7@v7.0.24/search.go:621 +0x86

Any steps to reproduce the behavior?

You're somehow passing a nil reference to the source method:

github.com/olivere/elastic/v7.(*TermsQuery).Source(0x0)