This query returns Zero hits. At the same time, when I submit this
query (via HTTP GET on port 9200) on the _search endpoint of that
index, I get results as expected.
This is happening when any of the values have spaces in them (please
note metadata.name as "call of duty"). If the values do not have
spaces, the queries sent through the TCP Connection work just as good
as them over HTTP.
This has put us in a fix - should we send all queries over HTTP and
then parse the results (much cumbersome), or is there something we are
missing while we are sending this query through the Java Driver as
val result = query.execute.actionGet()
Please let me know. I'd appreciate any hints or pointers.
This query returns Zero hits. At the same time, when I submit this
query (via HTTP GET on port 9200) on the _search endpoint of that
index, I get results as expected.
This is happening when any of the values have spaces in them (please
note metadata.name as "call of duty"). If the values do not have
spaces, the queries sent through the TCP Connection work just as good
as them over HTTP.
This has put us in a fix - should we send all queries over HTTP and
then parse the results (much cumbersome), or is there something we are
missing while we are sending this query through the Java Driver as
val result = query.execute.actionGet()
Please let me know. I'd appreciate any hints or pointers.
This query returns Zero hits. At the same time, when I submit this
query (via HTTP GET on port 9200) on the _search endpoint of that
index, I get results as expected.
This is happening when any of the values have spaces in them (please
note metadata.name as "call of duty"). If the values do not have
spaces, the queries sent through the TCP Connection work just as good
as them over HTTP.
This has put us in a fix - should we send all queries over HTTP and
then parse the results (much cumbersome), or is there something we are
missing while we are sending this query through the Java Driver as
val result = query.execute.actionGet()
Please let me know. I'd appreciate any hints or pointers.
-cheers,
Manish
Hi Shay - Thanks for your reply
Exactly! I am building the query using the SearchBuilder - like this:
setFrom(startIndex).setSize(count).setNoFields().setIndices(cf.searchConfiguration.indexName).
setTypes(cf.searchConfiguration.videoModel).addSort(sort,
if (sortOrder == "desc") SortOrder.DESC else SortOrder.ASC)
query.setFilter(superFilter)
Where I am adding more filters (as you can see from the output). At
the end I log the query variable, which renders the JSON that I pasted
above.
Next I do this :
val result = query.execute.actionGet()
Which returns me no results. However, when I paste the JSON produced
as the value of query, (on the server:9200/index/type/_search) I am
able to see the results. This is only happening when any of the values
contains a space. If there are no spaces, it works great via the Java
driver as well as HTTP.
Now I am trying to use Apache Commons HTTP Client to send the same
JSON over HTTP, but the client libraries do not support sending a body
with GET request. Sending the same on POST does not work obviously.
Next attempt would be to use Java's HttpURLConnection and hopefully
that'd let me send a payload over GET but if that too doesn't work, I
really am out of options
I think that there is something wrong with how you execute the search many
using the Java API, I am still missing the complete picture. Obviously,
something is strange here. If you can creata a simple test program, that
also initializes the index with some data, to show the failure, I will be
happy to look at it.
Regarding using the REST API, you can use POST as well to execute search,
not just GET. But, I think that you are giving up on the Java API too
fast...
This query returns Zero hits. At the same time, when I submit this
query (via HTTP GET on port 9200) on the _search endpoint of that
index, I get results as expected.
This is happening when any of the values have spaces in them (please
note metadata.name as "call of duty"). If the values do not have
spaces, the queries sent through the TCP Connection work just as good
as them over HTTP.
This has put us in a fix - should we send all queries over HTTP and
then parse the results (much cumbersome), or is there something we are
missing while we are sending this query through the Java Driver as
val result = query.execute.actionGet()
Please let me know. I'd appreciate any hints or pointers.
-cheers,
Manish
Hi Shay - Thanks for your reply
Exactly! I am building the query using the SearchBuilder - like this:
val query = new
SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).
setFrom(startIndex).setSize(count).setNoFields().setIndices(cf.searchConfiguration.indexName).
setTypes(cf.searchConfiguration.videoModel).addSort(sort,
if (sortOrder == "desc") SortOrder.DESC else SortOrder.ASC)
query.setFilter(superFilter)
Where I am adding more filters (as you can see from the output). At
the end I log the query variable, which renders the JSON that I pasted
above.
Next I do this :
val result = query.execute.actionGet()
Which returns me no results. However, when I paste the JSON produced
as the value of query, (on the server:9200/index/type/_search) I am
able to see the results. This is only happening when any of the values
contains a space. If there are no spaces, it works great via the Java
driver as well as HTTP.
Now I am trying to use Apache Commons HTTP Client to send the same
JSON over HTTP, but the client libraries do not support sending a body
with GET request. Sending the same on POST does not work obviously.
Next attempt would be to use Java's HttpURLConnection and hopefully
that'd let me send a payload over GET but if that too doesn't work, I
really am out of options
I think that there is something wrong with how you execute the search many
using the Java API, I am still missing the complete picture. Obviously,
something is strange here. If you can creata a simple test program, that
also initializes the index with some data, to show the failure, I will be
happy to look at it.
Regarding using the REST API, you can use POST as well to execute search,
not just GET. But, I think that you are giving up on the Java API too
fast...
This query returns Zero hits. At the same time, when I submit this
query (via HTTP GET on port 9200) on the _search endpoint of that
index, I get results as expected.
This is happening when any of the values have spaces in them (please
note metadata.name as "call of duty"). If the values do not have
spaces, the queries sent through the TCP Connection work just as good
as them over HTTP.
This has put us in a fix - should we send all queries over HTTP and
then parse the results (much cumbersome), or is there something we are
missing while we are sending this query through the Java Driver as
val result = query.execute.actionGet()
Please let me know. I'd appreciate any hints or pointers.
-cheers,
Manish
Hi Shay - Thanks for your reply
Exactly! I am building the query using the SearchBuilder - like this:
val query = new
SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).
Where I am adding more filters (as you can see from the output). At
the end I log the query variable, which renders the JSON that I pasted
above.
Next I do this :
val result = query.execute.actionGet()
Which returns me no results. However, when I paste the JSON produced
as the value of query, (on the server:9200/index/type/_search) I am
able to see the results. This is only happening when any of the values
contains a space. If there are no spaces, it works great via the Java
driver as well as HTTP.
Now I am trying to use Apache Commons HTTP Client to send the same
JSON over HTTP, but the client libraries do not support sending a body
with GET request. Sending the same on POST does not work obviously.
Next attempt would be to use Java's HttpURLConnection and hopefully
that'd let me send a payload over GET but if that too doesn't work, I
really am out of options
Hi Shay - Let me take another look at what is going on with my Java
Client. I'll probably put a test code with mapping file etc. on my
private repo on github and give you access to it if that helps.
Thanks again - We plan to put Elastic in Production as early as next
month, and except for this everything else has been sailing super
smooth
I think that there is something wrong with how you execute the search many
using the Java API, I am still missing the complete picture. Obviously,
something is strange here. If you can creata a simple test program, that
also initializes the index with some data, to show the failure, I will be
happy to look at it.
Regarding using the REST API, you can use POST as well to execute search,
not just GET. But, I think that you are giving up on the Java API too
fast...
This query returns Zero hits. At the same time, when I submit this
query (via HTTP GET on port 9200) on the _search endpoint of that
index, I get results as expected.
This is happening when any of the values have spaces in them (please
note metadata.name as "call of duty"). If the values do not have
spaces, the queries sent through the TCP Connection work just as good
as them over HTTP.
This has put us in a fix - should we send all queries over HTTP and
then parse the results (much cumbersome), or is there something we are
missing while we are sending this query through the Java Driver as
val result = query.execute.actionGet()
Please let me know. I'd appreciate any hints or pointers.
-cheers,
Manish
Hi Shay - Thanks for your reply
Exactly! I am building the query using the SearchBuilder - like this:
val query = new
SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).
Where I am adding more filters (as you can see from the output). At
the end I log the query variable, which renders the JSON that I pasted
above.
Next I do this :
val result = query.execute.actionGet()
Which returns me no results. However, when I paste the JSON produced
as the value of query, (on the server:9200/index/type/_search) I am
able to see the results. This is only happening when any of the values
contains a space. If there are no spaces, it works great via the Java
driver as well as HTTP.
Now I am trying to use Apache Commons HTTP Client to send the same
JSON over HTTP, but the client libraries do not support sending a body
with GET request. Sending the same on POST does not work obviously.
Next attempt would be to use Java's HttpURLConnection and hopefully
that'd let me send a payload over GET but if that too doesn't work, I
really am out of options
Hi Shay - Let me take another look at what is going on with my Java
Client. I'll probably put a test code with mapping file etc. on my
private repo on github and give you access to it if that helps.
Thanks again - We plan to put Elastic in Production as early as next
month, and except for this everything else has been sailing super
smooth
-cheers,
Manish
Hi Shay - My bad. I had the date format wrong, and should have been
using wildcardQuery. This is resolved now - thanks so much for your
replies.
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.