I appreciate if someone can let me know how do I pass the types names
using groovy client if I want my search to include many types . I've
tried to pass , (comma) separated names in variable "searchTypes" in
the code below but it didn't seem to work.
def res = getClient().search {
indices searchIndices
types searchTypes
source searchSource
}
The closure you pass gets evaluated into a SearchRequest object, which has a
method called: types(String... types). Note, you can always use the "static"
type APIs.
I appreciate if someone can let me know how do I pass the types names
using groovy client if I want my search to include many types . I've
tried to pass , (comma) separated names in variable "searchTypes" in
the code below but it didn't seem to work.
def res = getClient().search {
indices searchIndices
types searchTypes
source searchSource
}
Thanks! I got the idea how types(String... types) should be used. In
my code these types are dynamic. I need to sometimes pass a single
type and sometimes many types so I cannot use types(String... types)
as it forces me to hardcode the types (Probably a method signature
like types(String types) suits better for dynamically changing the
types.. similar to indices method). Could you elaborate more on use of
the "static" type APIs you mentioned or point me to some documentation
on it. May be I find some solution there...
The closure you pass gets evaluated into a SearchRequest object, which has a
method called: types(String... types). Note, you can always use the "static"
type APIs.
I appreciate if someone can let me know how do I pass the types names
using groovy client if I want my search to include many types . I've
tried to pass , (comma) separated names in variable "searchTypes" in
the code below but it didn't seem to work.
def res = getClient().search {
indices searchIndices
types searchTypes
source searchSource
}
It would be great if someone can elaborate what is meant by " "static"
type APIs." in this mail thread. I am new to the Elasticsearch
world... not able to find the meaning / documentation on it.
Thanks! I got the idea howtypes(String...types) should be used. In
my code thesetypesare dynamic. I need to sometimes pass a single
type and sometimes manytypesso I cannot usetypes(String...types)
as it forces me to hardcode thetypes(Probably a method signature
liketypes(String types) suits better for dynamically changing thetypes.. similar to indices method). Could you elaborate more on use of
the "static" type APIs you mentioned or point me to some documentation
on it. May be I find some solution there...
The closure you pass gets evaluated into a SearchRequest object, which has a
method called:types(String...types). Note, you can always use the "static"
type APIs.
I appreciate if someone can let me know how do I pass thetypesnames
usinggroovyclientif I want my search to include manytypes. I've
tried to pass , (comma) separated names in variable "searchTypes" in
the code below but it didn't seem to work.
def res = getClient().search {
indices searchIndices
typessearchTypes
source searchSource
}
Not sure I understand, if its a single value, why can't you call types? The
"static" method calls are just hte plain Java API calls, check the
prepareXXX method on the groovy client (which are the same in the wrapped
Java client).
Thanks! I got the idea how types(String... types) should be used. In
my code these types are dynamic. I need to sometimes pass a single
type and sometimes many types so I cannot use types(String... types)
as it forces me to hardcode the types (Probably a method signature
like types(String types) suits better for dynamically changing the
types.. similar to indices method). Could you elaborate more on use of
the "static" type APIs you mentioned or point me to some documentation
on it. May be I find some solution there...
The closure you pass gets evaluated into a SearchRequest object, which
has a
method called: types(String... types). Note, you can always use the
"static"
type APIs.
I appreciate if someone can let me know how do I pass the types names
using groovy client if I want my search to include many types . I've
tried to pass , (comma) separated names in variable "searchTypes" in
the code below but it didn't seem to work.
def res = getClient().search {
indices searchIndices
types searchTypes
source searchSource
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.