olivere / elastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch
https://olivere.github.io/elastic/
MIT License
7.39k stars 1.15k forks source link

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

Closed qqxhb closed 1 year ago

qqxhb commented 1 year ago

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?

olivere commented 1 year ago

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

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