#SearchRequest in ElasticsearchJava

1 messages · Page 1 of 1 (latest)

red swift
#

Goodmorning, i cant figure out the following:

i am trying to do a SearchRequest:

SearchRequest searchRequest = SearchRequest.of(srb -> srb.index(index)
                                                                 .seqNoPrimaryTerm(true)
                                                                 .size(0)
                                                                 .query(QueryBuilders.termsQuery("transaction_id", idList)));

but i keep getting the error:

Cannot resolve method 'query(TermsQueryBuilder)'

is there anyone who knows or can get me started in the right direction?

static troutBOT
#

<@&987246399047479336> please have a look, thanks.

static troutBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

hushed sandal
#

You're using termsQuery when what you actually want is a matchQuery

#

I'm on my phone so can't double check atm

red swift
#

hmm have this now: ```SearchRequest searchRequest = SearchRequest.of(srb -> srb.index(index)
.seqNoPrimaryTerm(true)
.size(0)
.query((Function<Query.Builder, ObjectBuilder<Query>>) QueryBuilders.termsQuery("transaction_id", idList)));

static troutBOT
red swift
#

but get the option to generify it