ok i get it now
thanks for your responses, they helped me track down the issue...
when using a query string that does not specify a field, i get the JSON
data back with hit.sourceAsString()
this is what was null
apparently when it i specify fields the data is available as raw values in
getFields
yes.. im an ES newbie
thx again for your responses
On Monday, March 4, 2013 2:38:22 PM UTC-6, David Pilato wrote:
I just add a note about your filter.
You should be aware that it's not applied to your facet. So your facet is
computed on all documents.
The fact is that when the field NUM_OF_WKS does not exist in the document,
no computation is done for that document…
--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs
Le 4 mars 2013 à 21:35, David Pilato <da...@pilato.fr <javascript:>> a
écrit :
Not sure of what happen here but, in Java, I recommend to use helper
methods.
I will probably write your query like this:
SearchResponse response = client.prepareSearch("scnprobldir3a")
.setTypes("dimItem")
.addField("NUM_OF_WKS")
.setFilter(FilterBuilders.existsFilter("NUM_OF_WKS"))
.addFacet(FacetBuilders.termsFacet("Number_of_Weeks_Facet").field("NUM_OF_WKS").size(100))
.execute().actionGet();
See java API documentation:
http://www.elasticsearch.org/guide/reference/java-api/
Does it help?
--
David Pilato | Technical Advocate | *Elasticsearch.comhttp://elasticsearch.com/
*
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs
Le 4 mars 2013 à 21:21, eric sanford <pcstechno...@gmail.com <javascript:>>
a écrit :
Hello, when i run this query...
{"filter":{"exists":{"field":"NUM_OF_WKS"}}, * "fields" : ["NUM_OF_WKS"]*,
"facets" :
{"Number_of_Weeks_Facet":{"terms":{"field":"NUM_OF_WKS","size":"1"} }}}
I corerctly get only the NUM_OF_WKS fleld back
but when i set the same query into a java search, i get null for that
fiels
final SearchResponse response = client.search(new
SearchRequest("scnprobldir3a").types("dimItem").source("{"filter":{"exists":{"field":"NUM_OF_WKS"}},
*"fields" : ["NUM_OF_WKS"]*, "facets" :
{"Number_of_Weeks_Facet":{"terms":{"field":"NUM_OF_WKS","size":"100"}
}}}")).actionGet();
Can anyone help with this
thank you !
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.