I'm new to this, please excuse me if this sounds like a dumb
questions. I'm still trying to figure it out how the java API works.
So I'm in need of build filters for my query (I've got between 0 to 5
filters) per search. And I'm using and "AndFilter.add" method to mix
them if they were passed as a search filter.
I found out it works just fine if I've got 2 or more filters. But I've
noticed that if I only pass one filter the generated JSON query fails
since it ends building up something like
filter: {
filters: { one_filter_here}
}
And ES doesn't like that.
What's the best strategy to build those filters so it has the
intelligence of just throw "filter" if one argument is passed, and
fitler: {filters: ..}} if more that one is passed?
Which client are you using? Can you gist the full search request that fails? The and filter can support a single filter, but it needs to exists within an array still.
On Tuesday, January 31, 2012 at 12:12 AM, david webb wrote:
Hello guys,
I'm new to this, please excuse me if this sounds like a dumb
questions. I'm still trying to figure it out how the java API works.
So I'm in need of build filters for my query (I've got between 0 to 5
filters) per search. And I'm using and "AndFilter.add" method to mix
them if they were passed as a search filter.
I found out it works just fine if I've got 2 or more filters. But I've
noticed that if I only pass one filter the generated JSON query fails
since it ends building up something like
filter: {
filters: { one_filter_here}
}
And ES doesn't like that.
What's the best strategy to build those filters so it has the
intelligence of just throw "filter" if one argument is passed, and
fitler: {filters: ..}} if more that one is passed?
Which client are you using? Can you gist the full search request that fails? The and filter can support a single filter, but it needs to exists within an array still.
On Tuesday, January 31, 2012 at 12:12 AM, david webb wrote:
Hello guys,
I'm new to this, please excuse me if this sounds like a dumb
questions. I'm still trying to figure it out how the java API works.
So I'm in need of build filters for my query (I've got between 0 to 5
filters) per search. And I'm using and "AndFilter.add" method to mix
them if they were passed as a search filter.
I found out it works just fine if I've got 2 or more filters. But I've
noticed that if I only pass one filter the generated JSON query fails
since it ends building up something like
filter: {
filters: { one_filter_here}
}
And ES doesn't like that.
What's the best strategy to build those filters so it has the
intelligence of just throw "filter" if one argument is passed, and
fitler: {filters: ..}} if more that one is passed?
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.