Re: Querying Nested documents

2015-07-15 Thread Ramesh Nuthalapati
Mikhail - 

This worked great.

http://localhost:8983/solr/demo/select?q={!parent 
which='type:parent'}image_uri_s:somevaluefl=*,[child 
parentFilter=type:parent 
childFilter=-type:parent]indent=true 

Thank you.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217534.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Querying Nested documents

2015-07-15 Thread Alessandro Benedetti
Thanks Mikhail, the post is really useful!
I will study it in details.

A slight change in the syntax change the query parsed.
Anyway just tried again q=(image_uri_s:somevalue) OR (-image_uri_s:*)
 query approach .

And actually it is working as expected:

q=(name:nome) OR (-name:*) ( give me all the documents containing a
specific name OR documents not containing the name at all )

response:{numFound:3,start:0,docs:[
  {
id:999,
name:nome,
_version_:150680568384128},
  {
id:99912,
_version_:1506804469258518528},
  {
id:9992,
_version_:1506805787028094976}]

in my simple example dataset .

Anyway, happy the user solved the problem!

Cheers



2015-07-15 17:38 GMT+01:00 Mikhail Khludnev mkhlud...@griddynamics.com:

 ok. I checked with with my data

 color:orlean  = numFound: 1,
 -color:[* TO *] = numFound: 602096 (it used to return 0 until 'pure
 negational' (sic) queries were delivered)
 color:orlean -color:[* TO *] = numFound: 0,
 color:orlean (*:* -color:[* TO *])  = numFound: 602097,

 fyi
 https://lucidworks.com/blog/why-not-and-or-and-not/


 On Wed, Jul 15, 2015 at 10:55 AM, Alessandro Benedetti 
 benedetti.ale...@gmail.com wrote:

  2015-07-15 16:01 GMT+01:00 Mikhail Khludnev mkhlud...@griddynamics.com
 :
 
   1. I can't get your explanation.
  
   2. childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)
   is not correct, lacks of quotes , and pointless (selecting some term,
 and
   negating all terms gives nothing).
 
 
  Not considering the syntax,
  We are talking about union of sets, not intersection.
  Why this query should give nothing ?
  Should return the union of all the children with some value in
 image_uri
  and the set with no value at all in that field .
 
 
   Thus, considerable syntax can be only
   childFilter=other_field:somevalue -image_uri_s:*
  
 
  I have to check, but probably you can answer me directly, is it not
  possible to express disjunctions there ?
 
 
  
   3.  I can only guess that you are asking about something like:
   http://localhost:8983/solr/demo/select?q={!parent
   which='type:parent'}image_uri_s:somevaluefl=*,[child
   parentFilter=type:parent
   childFilter=-type:parent]indent=true
  
  
   On Tue, Jul 14, 2015 at 11:56 PM, Ramesh Nuthalapati 
   ramesh.nuthalap...@gmail.com wrote:
  
Yes you are right.
   
So the query you are saying should be like below .. or did I
   misunderstood
it
   
http://localhost:8983/solr/demo/select?q= {!parent
which='type:parent'}fl=*,[child parentFilter=type:parent
childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)]indent=true
   
If so, I am getting an error with parsing field name.
   
   
   
--
View this message in context:
   
  
 
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217348.html
Sent from the Solr - User mailing list archive at Nabble.com.
   
  
  
  
   --
   Sincerely yours
   Mikhail Khludnev
   Principal Engineer,
   Grid Dynamics
  
   http://www.griddynamics.com
   mkhlud...@griddynamics.com
  
 
 
 
  --
  --
 
  Benedetti Alessandro
  Visiting card - http://about.me/alessandro_benedetti
  Blog - http://alexbenedetti.blogspot.co.uk
 
  Tyger, tyger burning bright
  In the forests of the night,
  What immortal hand or eye
  Could frame thy fearful symmetry?
 
  William Blake - Songs of Experience -1794 England
 



 --
 Sincerely yours
 Mikhail Khludnev
 Principal Engineer,
 Grid Dynamics

 http://www.griddynamics.com
 mkhlud...@griddynamics.com




-- 
--

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?

William Blake - Songs of Experience -1794 England


Re: Querying Nested documents

2015-07-15 Thread Alessandro Benedetti
2015-07-15 16:01 GMT+01:00 Mikhail Khludnev mkhlud...@griddynamics.com:

 1. I can't get your explanation.

 2. childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)
 is not correct, lacks of quotes , and pointless (selecting some term, and
 negating all terms gives nothing).


Not considering the syntax,
We are talking about union of sets, not intersection.
Why this query should give nothing ?
Should return the union of all the children with some value in image_uri
and the set with no value at all in that field .


 Thus, considerable syntax can be only
 childFilter=other_field:somevalue -image_uri_s:*


I have to check, but probably you can answer me directly, is it not
possible to express disjunctions there ?



 3.  I can only guess that you are asking about something like:
 http://localhost:8983/solr/demo/select?q={!parent
 which='type:parent'}image_uri_s:somevaluefl=*,[child
 parentFilter=type:parent
 childFilter=-type:parent]indent=true


 On Tue, Jul 14, 2015 at 11:56 PM, Ramesh Nuthalapati 
 ramesh.nuthalap...@gmail.com wrote:

  Yes you are right.
 
  So the query you are saying should be like below .. or did I
 misunderstood
  it
 
  http://localhost:8983/solr/demo/select?q= {!parent
  which='type:parent'}fl=*,[child parentFilter=type:parent
  childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)]indent=true
 
  If so, I am getting an error with parsing field name.
 
 
 
  --
  View this message in context:
 
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217348.html
  Sent from the Solr - User mailing list archive at Nabble.com.
 



 --
 Sincerely yours
 Mikhail Khludnev
 Principal Engineer,
 Grid Dynamics

 http://www.griddynamics.com
 mkhlud...@griddynamics.com




-- 
--

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?

William Blake - Songs of Experience -1794 England


Re: Querying Nested documents

2015-07-15 Thread Mikhail Khludnev
1. I can't get your explanation.

2. childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)
is not correct, lacks of quotes , and pointless (selecting some term, and
negating all terms gives nothing). Thus, considerable syntax can be only
childFilter=other_field:somevalue -image_uri_s:*

3.  I can only guess that you are asking about something like:
http://localhost:8983/solr/demo/select?q={!parent
which='type:parent'}image_uri_s:somevaluefl=*,[child
parentFilter=type:parent
childFilter=-type:parent]indent=true


On Tue, Jul 14, 2015 at 11:56 PM, Ramesh Nuthalapati 
ramesh.nuthalap...@gmail.com wrote:

 Yes you are right.

 So the query you are saying should be like below .. or did I misunderstood
 it

 http://localhost:8983/solr/demo/select?q= {!parent
 which='type:parent'}fl=*,[child parentFilter=type:parent
 childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)]indent=true

 If so, I am getting an error with parsing field name.



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217348.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

http://www.griddynamics.com
mkhlud...@griddynamics.com


Re: Querying Nested documents

2015-07-15 Thread Mikhail Khludnev
ok. I checked with with my data

color:orlean  = numFound: 1,
-color:[* TO *] = numFound: 602096 (it used to return 0 until 'pure
negational' (sic) queries were delivered)
color:orlean -color:[* TO *] = numFound: 0,
color:orlean (*:* -color:[* TO *])  = numFound: 602097,

fyi
https://lucidworks.com/blog/why-not-and-or-and-not/


On Wed, Jul 15, 2015 at 10:55 AM, Alessandro Benedetti 
benedetti.ale...@gmail.com wrote:

 2015-07-15 16:01 GMT+01:00 Mikhail Khludnev mkhlud...@griddynamics.com:

  1. I can't get your explanation.
 
  2. childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)
  is not correct, lacks of quotes , and pointless (selecting some term, and
  negating all terms gives nothing).


 Not considering the syntax,
 We are talking about union of sets, not intersection.
 Why this query should give nothing ?
 Should return the union of all the children with some value in image_uri
 and the set with no value at all in that field .


  Thus, considerable syntax can be only
  childFilter=other_field:somevalue -image_uri_s:*
 

 I have to check, but probably you can answer me directly, is it not
 possible to express disjunctions there ?


 
  3.  I can only guess that you are asking about something like:
  http://localhost:8983/solr/demo/select?q={!parent
  which='type:parent'}image_uri_s:somevaluefl=*,[child
  parentFilter=type:parent
  childFilter=-type:parent]indent=true
 
 
  On Tue, Jul 14, 2015 at 11:56 PM, Ramesh Nuthalapati 
  ramesh.nuthalap...@gmail.com wrote:
 
   Yes you are right.
  
   So the query you are saying should be like below .. or did I
  misunderstood
   it
  
   http://localhost:8983/solr/demo/select?q= {!parent
   which='type:parent'}fl=*,[child parentFilter=type:parent
   childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)]indent=true
  
   If so, I am getting an error with parsing field name.
  
  
  
   --
   View this message in context:
  
 
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217348.html
   Sent from the Solr - User mailing list archive at Nabble.com.
  
 
 
 
  --
  Sincerely yours
  Mikhail Khludnev
  Principal Engineer,
  Grid Dynamics
 
  http://www.griddynamics.com
  mkhlud...@griddynamics.com
 



 --
 --

 Benedetti Alessandro
 Visiting card - http://about.me/alessandro_benedetti
 Blog - http://alexbenedetti.blogspot.co.uk

 Tyger, tyger burning bright
 In the forests of the night,
 What immortal hand or eye
 Could frame thy fearful symmetry?

 William Blake - Songs of Experience -1794 England




-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

http://www.griddynamics.com
mkhlud...@griddynamics.com


Re: Querying Nested documents

2015-07-14 Thread rameshn
The problem is filtering based on a element in 1234-images doc.

doc 
field name=id1234-images/field 
field name=image_uri_shttp://somedomain.com/some.jpg/field 
field name=image_flatten_s1:1/field 
/doc 

I have multiple combinations of image_flatten_s and image_uri_s and
should be able to query / filter on those values for
image_uri_s:http://somedomain.com/some.jpg; or
http://otherdomain.com/other.jpg;

The query you gave will give me all *-images documents irrespective of
image_uri_s value. I want to filter based on the image_uri_s value, but
still return all other children since there is no filter in the other
children.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217258.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Querying Nested documents

2015-07-14 Thread Alessandro Benedetti
Do you mean this ?
I want all the children with a specific value for image_uri_s and all the
children which have not that value.
In this case i would go with :

childFilter=(image_uri_s:whatever ...) OR (-image_uri_s:*)

Is this what do you want ?

Cheers

2015-07-14 14:58 GMT+01:00 rameshn ramesh.nuthalap...@gmail.com:

 The problem is filtering based on a element in 1234-images doc.

 doc
 field name=id1234-images/field
 field name=image_uri_shttp://somedomain.com/some.jpg
 /field
 field name=image_flatten_s1:1/field
 /doc

 I have multiple combinations of image_flatten_s and image_uri_s and
 should be able to query / filter on those values for
 image_uri_s:http://somedomain.com/some.jpg; or
 http://otherdomain.com/other.jpg;

 The query you gave will give me all *-images documents irrespective of
 image_uri_s value. I want to filter based on the image_uri_s value, but
 still return all other children since there is no filter in the other
 children.



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217258.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
--

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?

William Blake - Songs of Experience -1794 England


Re: Querying Nested documents

2015-07-14 Thread Ramesh Nuthalapati
Yes you are right.

So the query you are saying should be like below .. or did I misunderstood
it

http://localhost:8983/solr/demo/select?q= {!parent
which='type:parent'}fl=*,[child parentFilter=type:parent
childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)]indent=true

If so, I am getting an error with parsing field name.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217348.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Querying Nested documents

2015-07-14 Thread Alessandro Benedetti
Not sure the '-' is supported by that queryParser, can you check with the
NOT operator ?
If not I will check in the code.

Cheers

2015-07-14 21:56 GMT+01:00 Ramesh Nuthalapati ramesh.nuthalap...@gmail.com
:

 Yes you are right.

 So the query you are saying should be like below .. or did I misunderstood
 it

 http://localhost:8983/solr/demo/select?q= {!parent
 which='type:parent'}fl=*,[child parentFilter=type:parent
 childFilter=(image_uri_s:somevalue) OR (-image_uri_s:*)]indent=true

 If so, I am getting an error with parsing field name.



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217169p4217348.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
--

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?

William Blake - Songs of Experience -1794 England


Re: Querying Nested documents

2015-07-13 Thread Mikhail Khludnev
what about?
http://localhost:8983/solr/demo/select?q={!parent%20which=%27type:parent%27}fl=*,[child%20parentFilter=type:parent%20childFilter=-type:parent]indent=true



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

http://www.griddynamics.com
mkhlud...@griddynamics.com


Re: Querying Nested documents

2015-07-13 Thread Alessandro Benedetti
Hi Rameshn,
I would suggest you to rewrite your mail.
It is really heavy to understand!
Try to format your document and nested document in a nice way ( remember a
document is a map field- value), let's try to not over complicate the
things !

Furthermore, try to express the query as well not encoded.
It will let us help you much more efficiently, without loosing 10 minutes
decoding the mail :)

Cheers

2015-07-13 17:03 GMT+01:00 rameshn ramesh.nuthalap...@gmail.com:

 Hi, I have question regarding nested documents.My document looks like
 below,
 1234xger00parent
 2015-06-15T13:29:07ZegeDuperhttp://www.domain.com
 zoome1234-images
 http://somedomain.com/some.jpg1:1
 1234-platform-iosios
 https://somedomain.comsomelinkfalse
 2015-03-23T10:58:00Z-12-30T19:00:00Z
 1234-platform-androidandroid
 somedomain.comsomelinkfalse
 2015-03-23T10:58:00Z-12-30T19:00:00Z
 Right now I can query like

 thishttp://localhost:8983/solr/demo/select?q={!parent%20which=%27type:parent%27}fl=*,[child%20parentFilter=type:parent%20childFilter=image_uri_s:*]indent=trueand
 get the parent and child document with matching criteria (just parent and
 image child document).*But, I want to get all other children*
 (1234-platform-ios and 1234-platform-andriod) even if i query based on
 image_uri_s (1234-images) although they are other children which are part
 of
 the parent document.Is it possible ?Appreciate your help !Thanks,Ramesh



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217088.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
--

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?

William Blake - Songs of Experience -1794 England


Re: Querying Nested documents

2015-07-13 Thread Steve Rowe
Hi rameshn,

Nabble has a nasty habit of stripping out HTML and XML markup before sending 
your mail out to the mailing list - see your message quoted below for how it 
appears to people who aren’t reading via Nabble.

My suggestion: directly subscribe to the solr-user mailing list[1] and avoid 
Nabble.  (They’ve known about the problem for many years and AFAICT have done 
nothing about it.)

Steve

[1] https://lucene.apache.org/solr/resources.html#mailing-lists

 On Jul 13, 2015, at 12:03 PM, rameshn ramesh.nuthalap...@gmail.com wrote:
 
 Hi, I have question regarding nested documents.My document looks like below,  
   
 1234xger00parent  
  
 2015-06-15T13:29:07ZegeDuperhttp://www.domain.com 
   
 zoome1234-images   
 http://somedomain.com/some.jpg1:1   
 1234-platform-iosios   
 https://somedomain.comsomelinkfalse   
 2015-03-23T10:58:00Z-12-30T19:00:00Z  
 
 1234-platform-androidandroid   
 somedomain.comsomelinkfalse   
 2015-03-23T10:58:00Z-12-30T19:00:00Z  
 Right now I can query like
 thishttp://localhost:8983/solr/demo/select?q={!parent%20which=%27type:parent%27}fl=*,[child%20parentFilter=type:parent%20childFilter=image_uri_s:*]indent=trueand
 get the parent and child document with matching criteria (just parent and
 image child document).*But, I want to get all other children*
 (1234-platform-ios and 1234-platform-andriod) even if i query based on
 image_uri_s (1234-images) although they are other children which are part of
 the parent document.Is it possible ?Appreciate your help !Thanks,Ramesh
 
 
 
 --
 View this message in context: 
 http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217088.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: Querying Nested documents

2015-07-13 Thread rameshn
My sincere Apologies.

Re-submitted directly to the list. 

Thank you.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Querying-Nested-documents-tp4217088p4217166.html
Sent from the Solr - User mailing list archive at Nabble.com.