The size parameter isn't working on either a query based or uri
search. "hits" will give me the correct number or results (say,
something like 27), but I still only get the first 10 results.
The first curl looks good, do you get total_hits that is higher then 10, and you say you only get 10 back? Can you gist a repro in this case? The second curl is wrong since size is another parameter, and should be separated using & from the q parameter.
On Saturday, June 25, 2011 at 11:00 PM, Josh JRG wrote:
The size parameter isn't working on either a query based or uri
search. "hits" will give me the correct number or results (say,
something like 27), but I still only get the first 10 results.
Actually, the first curl causes elasticsearch to throw an "unable to
parse" error. Am I improperly constructing a multi-term query? Is my
syntax wrong? Yes, total_hits comes back as a number higher than 10 (I
believe it was 14 in my example), but the number of matching records
being returned is still only 10. I'm unable to post a repro from my
current location, but I will be able to tomorrow morning. I believe
that was primarily occurring on my second curl (and you've explained
why that is happening) though as the first one was giving me a parsing
error. Is there any way to to a multi-term query with the URI format
with something like: q=term:value, term2=value2&size=100 or is that
not possible? I'm new to this, so getting a good grasp on the syntax
is still an issue.
The first curl looks good, do you get total_hits that is higher then 10, and you say you only get 10 back? Can you gist a repro in this case? The second curl is wrong since size is another parameter, and should be separated using & from the q parameter.
On Saturday, June 25, 2011 at 11:00 PM, Josh JRG wrote:
The size parameter isn't working on either a query based or uri
search. "hits" will give me the correct number or results (say,
something like 27), but I still only get the first 10 results.
Yes, your first curl is not correct when it comes to the query structure. What do you mean by doing a query like term:value? You mean field:value? You want to query several fields?
On Sunday, June 26, 2011 at 4:46 AM, Josh JRG wrote:
Actually, the first curl causes elasticsearch to throw an "unable to
parse" error. Am I improperly constructing a multi-term query? Is my
syntax wrong? Yes, total_hits comes back as a number higher than 10 (I
believe it was 14 in my example), but the number of matching records
being returned is still only 10. I'm unable to post a repro from my
current location, but I will be able to tomorrow morning. I believe
that was primarily occurring on my second curl (and you've explained
why that is happening) though as the first one was giving me a parsing
error. Is there any way to to a multi-term query with the URI format
with something like: q=term:value, term2=value2&size=100 or is that
not possible? I'm new to this, so getting a good grasp on the syntax
is still an issue.
The first curl looks good, do you get total_hits that is higher then 10, and you say you only get 10 back? Can you gist a repro in this case? The second curl is wrong since size is another parameter, and should be separated using & from the q parameter.
On Saturday, June 25, 2011 at 11:00 PM, Josh JRG wrote:
The size parameter isn't working on either a query based or uri
search. "hits" will give me the correct number or results (say,
something like 27), but I still only get the first 10 results.
Note: I have used a 'text' query instead of a 'term' query, because a
term query is probably not what you are after. Term queries only match
if exactly the same term is stored in your database, eg "Foo" won't
match "foo".
If you haven't actually specified {index: "not_analyzed"} on your term1
and term2 fields, then they are probably set to be analyzed (ie treated
as full text, not discrete terms).
Either way, the 'text' query will do the right thing: if the field is
analyzed, then it will treat it as a full text search, and if it is
not_analyzed, then it will do a term query instead.
Yes, I'm trying to query several fields. I've got several vignettes,
each with a defined set of metadata indexed in ES and I'm trying to
query one or more of those common fields, so yes I was to do
field:value. I think Clint may have provided me with an answer. I'll
try out what you guys have suggested and come back with results.
Thanks.
Yes, your first curl is not correct when it comes to the query structure. What do you mean by doing a query like term:value? You mean field:value? You want to query several fields?
On Sunday, June 26, 2011 at 4:46 AM, Josh JRG wrote:
Actually, the first curl causes elasticsearch to throw an "unable to
parse" error. Am I improperly constructing a multi-term query? Is my
syntax wrong? Yes, total_hits comes back as a number higher than 10 (I
believe it was 14 in my example), but the number of matching records
being returned is still only 10. I'm unable to post a repro from my
current location, but I will be able to tomorrow morning. I believe
that was primarily occurring on my second curl (and you've explained
why that is happening) though as the first one was giving me a parsing
error. Is there any way to to a multi-term query with the URI format
with something like: q=term:value, term2=value2&size=100 or is that
not possible? I'm new to this, so getting a good grasp on the syntax
is still an issue.
The first curl looks good, do you get total_hits that is higher then 10, and you say you only get 10 back? Can you gist a repro in this case? The second curl is wrong since size is another parameter, and should be separated using & from the q parameter.
On Saturday, June 25, 2011 at 11:00 PM, Josh JRG wrote:
The size parameter isn't working on either a query based or uri
search. "hits" will give me the correct number or results (say,
something like 27), but I still only get the first 10 results.
The text query actually didn't work. I'm looking to exactly match two
or more field : value pairs I know to be present in at least one of my
indexed items and a text search gives me back 0 hits.
Note: I have used a 'text' query instead of a 'term' query, because a
term query is probably not what you are after. Term queries only match
if exactly the same term is stored in your database, eg "Foo" won't
match "foo".
If you haven't actually specified {index: "not_analyzed"} on your term1
and term2 fields, then they are probably set to be analyzed (ie treated
as full text, not discrete terms).
Either way, the 'text' query will do the right thing: if the field is
analyzed, then it will treat it as a full text search, and if it is
not_analyzed, then it will do a term query instead.
On Sun, 2011-06-26 at 08:29 -0700, Josh JRG wrote:
The text query actually didn't work. I'm looking to exactly match two
or more field : value pairs I know to be present in at least one of my
indexed items and a text search gives me back 0 hits.
Nevermind, there was a copy and paste error (not the end quote on
bool) that I kept replicating. The multi-field text search seems to
work perfectly. Thanks Clint. I am very grateful for your help.
On Sun, 2011-06-26 at 08:29 -0700, Josh JRG wrote:
The text query actually didn't work. I'm looking to exactly match two
or more field : value pairs I know to be present in at least one of my
indexed items and a text search gives me back 0 hits.
As I said, I know that that combination should give me back at least 2
hits, but I'm currently getting nothing.
I assume that in your actual test you quote "bool" correctly?
I suggest that you gist (seehttp://www.elasticsearch.org/help) a
complete recreation of what you're doing, otherwise it is difficult to
figure out where you are going wrong
Yes, your first curl is not correct when it comes to the query structure. What do you mean by doing a query like term:value? You mean field:value? You want to query several fields?
On Sunday, June 26, 2011 at 4:46 AM, Josh JRG wrote:
Actually, the first curl causes elasticsearch to throw an "unable to
parse" error. Am I improperly constructing a multi-term query? Is my
syntax wrong? Yes, total_hits comes back as a number higher than 10 (I
believe it was 14 in my example), but the number of matching records
being returned is still only 10. I'm unable to post a repro from my
current location, but I will be able to tomorrow morning. I believe
that was primarily occurring on my second curl (and you've explained
why that is happening) though as the first one was giving me a parsing
error. Is there any way to to a multi-term query with the URI format
with something like: q=term:value, term2=value2&size=100 or is that
not possible? I'm new to this, so getting a good grasp on the syntax
is still an issue.
The first curl looks good, do you get total_hits that is higher then 10, and you say you only get 10 back? Can you gist a repro in this case? The second curl is wrong since size is another parameter, and should be separated using & from the q parameter.
On Saturday, June 25, 2011 at 11:00 PM, Josh JRG wrote:
The size parameter isn't working on either a query based or uri
search. "hits" will give me the correct number or results (say,
something like 27), but I still only get the first 10 results.
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.