nested filter query issue

2014-10-20 Thread shekhar chauhan
Hi All,
  I am working on nested filter query.But this query is searching only on 
nested object properties of type int ,double,date.But not searching when 
the properties of string type.
My document structure is given below-

sectionResults: [
   {
   SectionName: Project Details,
   itemResults: [
   {
   InspectionItem: Project Id,

   Value: asd,
   NumericValue: 0,
   DoubleValue: 1,
   LongValue: 0,
   DateValue: 2014-10-08T00:00:00
   }

]

   }

]



and my query is -


{

  query: {

filtered: {

  query: {

match_all: {}

  },

  filter: {

nested: {

  path: sectionResults.itemResults,

  filter: {

bool: {

  must: [ 

{

  range: {

sectionResults.itemResults.DateValue: {

  from: 2014-10-01,

  to: 2014-10-08

}

  }

},

{

  term: {

sectionResults.itemResults.InspectionItem: Project Id

  }

}

  ]

}

  },

  _cache: true

}

}

  }

}

  } 


For Example - If i do search on InspectionItem Property of itemResults.then 
result found is 0.But gives reults in case of DateValue,DoubleValue properties 
of object itemResults .Please help.

Thanks in advance,







-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/8688c1c4-8111-41e2-af4d-ad2e47295ad6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: nested type mapping error

2014-10-16 Thread shekhar chauhan
Is there anyone to help me about the above problem?...please help me..

Thanks in advance,

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/098e9176-fd1c-473c-9ca3-9d62de679ee9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


problem in search nested type object

2014-10-16 Thread shekhar chauhan
Hi All,
  I am facing a problem in searcing a nested object.My document structure 
is -

{
   sectionResults: [
   {
   SectionName: More Details,
   itemResults: [
   
   {
   InspectionItem: Project Name,
   ItemInfo: 
   
   }
   ]
   }
  
   ]
}

and I have used this mapping query to make itemResults object(in document) 
of nested type - 
PUT realtek_release_v6_nestedsearch/_mapping
{
  realtek_release_v6_nestedsearch:{
properties: {
  sectionResults:{
type: object,
properties: {
  itemResults:{
type: nested
  }
}
  }
}
  }
}

then i have checked the mapping .In mapping itemResults of nested type. 
Everything if fine here.
But problem comes in searching query for nested object.my searching query 
is - 

query: {
filtered: {
  query: {
match_all: {}
  },
  filter: {
nested: {
  path: sectionResults.itemResults,
  filter: {
bool: {
  must: [ 
{
  term: {
itemResults.InspectionItem: Project Name
  }
}
  ]
}
  }
}
}
  }
}

this query returns 0 matching results.but result exists in database.I do 
not know whether i am doing mistake in mapping or search query.Please help.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/59cadcb5-33a1-4da1-a552-95a989a77904%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: nested filter query giving error

2014-10-15 Thread shekhar chauhan
Hi Adrien,
  Thanks for your reply.but Now I am facing a new problem.How to do mapping 
of making a object of nested type.

my document structure is - 

{
   _id: inspectionresults-07d864fd-76ec-427a-a1c6-b70e420ce3d8,
   _rev: 12-64c44ddcfcd477dfa86cdb9d3c659748,
   sectionResults: [
   
   {
   SectionName: More Details,
   itemResults: [
   
   {
   InspectionItem: Launch Month,
   ItemInfo: 
   
   }
   ]
   }
  
   ]
}

and my query is - 
PUT realtek_release_v6_nestedsearch/_mapping
{
  realtek_release_v6_nestedsearch:{
properties: {
  sectionResults:{
type: object,
properties: {
  itemResults:{
type: nested
  }
}
  }
}
  }
}

error is -  nested object under path [sectionResults] is not of nested 
type

please send me query according to my document structure.i only wants 
itemResults object of nested type.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/4be1b236-9233-4d41-a66c-a821667ed4ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


nested type mapping error

2014-10-15 Thread shekhar chauhan
Hi All,
  I am facing a problem.How to do mapping of making a object of nested 
type.I* only wants itemResults object of nested type.*

my document structure is - 

{
   _id: inspectionresults-07d864fd-76ec-427a-a1c6-b70e420ce3d8,
   _rev: 12-64c44ddcfcd477dfa86cdb9d3c659748,
   sectionResults: [
   
   {
   SectionName: More Details,
   itemResults: [
   
   {
   InspectionItem: Launch Month,
   ItemInfo: 
   
   }
   ]
   }
  
   ]
}

and my query is - 
PUT realtek_release_v6_nestedsearch/_mapping
{
  realtek_release_v6_nestedsearch:{
properties: {
  sectionResults:{
type: object,
properties: {
  itemResults:{
type: nested
  }
}
  }
}
  }
}

error is -  nested object under path [sectionResults] is not of nested 
type

please send me query according to my document structure.*i only wants 
itemResults object of nested type*.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/7e301db9-8160-475c-90f9-42ae87dcb748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


nested filter query giving error

2014-10-14 Thread shekhar chauhan
Hi all,
 I am new to elastic search.I am using nested filter query.this query is 
giving error failed to find nested object under path [itemResults]].

my document structure is -

{
   _id: inspectionresults-07d864fd-76ec-427a-a1c6-b70e420ce3d8,
   _rev: 12-64c44ddcfcd477dfa86cdb9d3c659748,
   sectionResults: [
   
   {
   SectionName: More Details,
   itemResults: [
   
   {
   InspectionItem: Launch Month,
   ItemInfo: 
   
   }
   ]
   }
  
   ]
}

and my query is - 

{
  query: {
filtered: {
  query: {
match_all: {}
  },
  filter: {
nested: {
  path: itemResults,
  filter: {
bool: {
  must: [
{
  term: {
itemResults.InspectionItem: Launch Month
  }
}
  ]
}
  }
}
}
  }
}
  }  

Error - failed to find nested object under path [itemResults]]

But as you are seeing in document itemResults is already nested object.
Please reply.
Thanks in advance,

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/a38b570f-64ac-44e6-8424-59ffb6bafa52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Nested Filter

2014-10-13 Thread shekhar chauhan
Hi All,
  I am facing a problem in implementation of Nested Filter.I have attached 
a document.Please first see it. My requirement is - i want to perform 
nested filter on  the sectionResults.itemResults.InspectionItem and 
sectionResults.itemResults.DateValue(on both together). I have already 
attached my couchdb database document to this mail.
and i am trying this -

GET realtek_release_v6/_search
{
 query: {
filtered: {
  query: {
match: {
   ChecklistName: NP Online
}
  },
  filter: {
nested: {
  path: sectionResults.itemResults,
  filter:{
bool: {
  must: [
{
  range: {
sectionResults.itemResults.DateValue: {
  from: 2014-10-01,
  to: 2104-10-08
}
  }
},
{
  term: {
sectionResults.itemResults.InspectionItem: Launch 
Month
  }
}
  ]
}
  }
}
  }
}
  }
}

but it is not working.Please help me.

Thanks in advance.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/5c5002b9-697c-464c-827d-4b1f6b2235bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{
   _id: inspectionresults-07d864fd-76ec-427a-a1c6-b70e420ce3d8,
   _rev: 12-64c44ddcfcd477dfa86cdb9d3c659748,
   ChecklistName: NP Online,
   checklistId: checklist-51843214-f761-4f4f-89c2-fae82fb49fec,
   CreatedOn: 2014-10-08T14:20:23.6034+05:30,
   sectionResults: [
   
   {
   SectionName: More Details,
   SectionInfo: ,
   SectionRepeatCount: 0,
   RepeatedChildNumber: 0,
   itemResults: [
   
   {
   InspectionItem: Launch Month,
   ItemInfo: ,
   Result: inprogress,
   Value: ,
   ReportMapping: ,
   CaptionList: [
   ],
   Values: [
   ],
   NumericValue: 0,
   DoubleValue: 0,
   LongValue: 0,
   DateValue: 2014-10-08T14:20:23.6034+05:30
   }
   ]
   }
  
   ],
   Type: inspectionresults
}