Hi
I have indexed the following document (as indicated below) in elastic
search and attempting to apply a filter query using Java API (code
below)
However I am not receiving any results .
Code is indicated below. Please assist to let me know if I am missing
anything.
NOTE: StartTime and EndTime is mapped as DATE type
{
"schedules":
[
{
"Classification" : "schedule",
"type" : "outlookcalendar",
"Id":
"AAMkADdmMDM4ZDZjLThkYjItNGZkYi05MDMyLWE3YzFkNWJkZWY1MABGAAAAAAAzlc4LRfuqSp
TimVdZOAM5BwDVH
+l4CJ/IRKcSEvbCqPNfAQtPns0bAADVH+l4CJ/IRKcSEvbCqPNfAQtPo/jDAAA=",
"Subject":"Meet JK in Mountain View",
"Location":"Red Rock Cafe",
"StartTime": "Thu Jan 05 01:00:00 PST 2012",
"EndTime": "Thu Jan 05 02:00:00 PST 2012",
"Organizer": "t...@test.com",
"Body": "",
"RequiredAttendees": "",
"OptionalAttendees": "",
}
}
do a response.getHits() and check the size of the collection returned.
You should also try to build the query by hand with JSON and send it to
your ES instance.
On Sunday, May 13, 2012 9:06:00 AM UTC-4, ama sindhuc wrote:
Hi
I have indexed the following document (as indicated below) in elastic
search and attempting to apply a filter query using Java API (code
below)
However I am not receiving any results .
Code is indicated below. Please assist to let me know if I am missing
anything.
NOTE: StartTime and EndTime is mapped as DATE type
{
"schedules":
[
{
"Classification" : "schedule",
"type" : "outlookcalendar",
"Id":
"AAMkADdmMDM4ZDZjLThkYjItNGZkYi05MDMyLWE3YzFkNWJkZWY1MABGAAAAAAAzlc4LRfuqSp
TimVdZOAM5BwDVH
+l4CJ/IRKcSEvbCqPNfAQtPns0bAADVH+l4CJ/IRKcSEvbCqPNfAQtPo/jDAAA=",
"Subject":"Meet JK in Mountain View",
"Location":"Red Rock Cafe",
"StartTime": "Thu Jan 05 01:00:00 PST 2012",
"EndTime": "Thu Jan 05 02:00:00 PST 2012",
"Organizer": "t...@test.com",
"Body": "",
"RequiredAttendees": "",
"OptionalAttendees": "",
}
}
The intended query is (classification = "schedule" AND type =
"email)
AND (range form Date(2012-5-01) to DATE(2012-7-01))
Code
package com.o1logic.services;
import
org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder
;
import
org.elasticsearch.action.admin.indices.settings.UpdateSettingsRequestBuilde
When you use a term filter, make sure that the data for the indexed
document did not end up being analyzed to a different terms. You can
control that using mappings for example by setting the relevant field index
to be not_analyzed.
When having problems with something you can't find, start broadening the
query / filters (for example, don't do the term filter) and see if you do
manage to find data. Once you find the one that removes results that you
expect, then its simpler to understand why it does not work.
Hi
I have indexed the following document (as indicated below) in elastic
search and attempting to apply a filter query using Java API (code
below)
However I am not receiving any results .
Code is indicated below. Please assist to let me know if I am missing
anything.
NOTE: StartTime and EndTime is mapped as DATE type
{
"schedules":
[
{
"Classification" : "schedule",
"type" : "outlookcalendar",
"Id":
"AAMkADdmMDM4ZDZjLThkYjItNGZkYi05MDMyLWE3YzFkNWJkZWY1MABGAAAAAAAzlc4LRfuqSp
TimVdZOAM5BwDVH
+l4CJ/IRKcSEvbCqPNfAQtPns0bAADVH+l4CJ/IRKcSEvbCqPNfAQtPo/jDAAA=",
"Subject":"Meet JK in Mountain View",
"Location":"Red Rock Cafe",
"StartTime": "Thu Jan 05 01:00:00 PST 2012",
"EndTime": "Thu Jan 05 02:00:00 PST 2012",
"Organizer": "t...@test.com",
"Body": "",
"RequiredAttendees": "",
"OptionalAttendees": "",
}
}
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.