more than 1 join on the same query
Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr
Re: more than 1 join on the same query
try fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left Dom 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux
Re: more than 1 join on the same query
This fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left works even if I have attr1=left1 in the second condition. My goal is to select bodies that matches both conditions. It's strange, but if I try fq = {!join from=root_id to=id}type:legattr1=right AND {!join from=root_id to=id}type:armattr1=left it returns zero results, but the body exists. I am guessing it's trying to query for childs which have type equals to both leg AND arm and attr1 equals to both right AND left... Not sure... 2013/7/10 Dominique Debailleux dominique.debaill...@woana.net try fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left Dom 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr
Re: more than 1 join on the same query
Sorry, I didn't check preciselyI guess in your sample attr1 applies to the body, not the legs, that could explain your problem 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com This fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left works even if I have attr1=left1 in the second condition. My goal is to select bodies that matches both conditions. It's strange, but if I try fq = {!join from=root_id to=id}type:legattr1=right AND {!join from=root_id to=id}type:armattr1=left it returns zero results, but the body exists. I am guessing it's trying to query for childs which have type equals to both leg AND arm and attr1 equals to both right AND left... Not sure... 2013/7/10 Dominique Debailleux dominique.debaill...@woana.net try fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left Dom 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux
Re: more than 1 join on the same query
Dominique, I tried also: fq = {!join from=root_id to=id}type:leg AND {!join from=root_id to=id}type:arm If I understood what you said correctly, that should return something too, right? It also got me 0 results... 2013/7/10 Dominique Debailleux dominique.debaill...@woana.net Sorry, I didn't check preciselyI guess in your sample attr1 applies to the body, not the legs, that could explain your problem 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com This fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left works even if I have attr1=left1 in the second condition. My goal is to select bodies that matches both conditions. It's strange, but if I try fq = {!join from=root_id to=id}type:legattr1=right AND {!join from=root_id to=id}type:armattr1=left it returns zero results, but the body exists. I am guessing it's trying to query for childs which have type equals to both leg AND arm and attr1 equals to both right AND left... Not sure... 2013/7/10 Dominique Debailleux dominique.debaill...@woana.net try fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left Dom 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr
Re: more than 1 join on the same query
Got puzzled now! If instead of AND I use , it works: fq = {!join from=root_id to=id}type:leg {!join from=root_id to=id}type:arm I am definitly missing something, I don't know what... Shouldn't both be the same? []s 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com Dominique, I tried also: fq = {!join from=root_id to=id}type:leg AND {!join from=root_id to=id}type:arm If I understood what you said correctly, that should return something too, right? It also got me 0 results... 2013/7/10 Dominique Debailleux dominique.debaill...@woana.net Sorry, I didn't check preciselyI guess in your sample attr1 applies to the body, not the legs, that could explain your problem 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com This fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left works even if I have attr1=left1 in the second condition. My goal is to select bodies that matches both conditions. It's strange, but if I try fq = {!join from=root_id to=id}type:legattr1=right AND {!join from=root_id to=id}type:armattr1=left it returns zero results, but the body exists. I am guessing it's trying to query for childs which have type equals to both leg AND arm and attr1 equals to both right AND left... Not sure... 2013/7/10 Dominique Debailleux dominique.debaill...@woana.net try fq = {!join from=root_id to=id}type:legattr1=right OR {!join from=root_id to=id}type:armattr1=left Dom 2013/7/10 Marcelo Elias Del Valle mvall...@gmail.com Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr
Re: more than 1 join on the same query
Be careful with URL encoding... that may be messing you up depending on how you are trying to submit the query (and the single you were using as AND) fq={!join from=root_id to=id}type:arm AND attr1=left fq={!join from=root_id to=id}type:leg AND attr1=right -Yonik http://lucidworks.com On Wed, Jul 10, 2013 at 12:56 PM, Marcelo Elias Del Valle mvall...@gmail.com wrote: Hello, I am playing with joins here just to test what I can do with them. I have been learning a lot, but I am still having some troubles with more complex queries. For example, suppose I have the following documents: - id = 1 - name = Humblebee - age = 1000 - id = 2 - type = arm - attr1 = left - size = 45 - unit = cm - root_id = 1 - id = 3 - type = arm - attr1 = right - size = 46 - unit = cm - root_id = 1 - id = 4 - type = leg - attr1 = left - size = 50 - unit = cm - root_id = 1 - id = 5 - type = leg - attr1 = right - size = 52 - unit = cm - root_id = 1 In my case, that would mean there is a body called humblebee with id 1 and 4 child, each one a member of the body. What I am trying to do: select all bodies (root entities) that have a left arm and a right leg. To select the body based on the left arm, I would do: - q = *:* - fq = {!join from=root_id to=id}type:armattr1=left To select the body based on the right leg: - q = *:* - fq = {!join from=root_id to=id}type:legattr1=right But what if I need both left arm AND right leg? Should I do 2 joins? Best regards, -- Marcelo Elias Del Valle http://mvalle.com - @mvallebr