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
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: Is there a way to limit returned rows directly in a query string?
Hi yun Not sure to understand your need... There is no relationship between a query string and DIH. What you want to achieve (if fetch 1 rows means select 1 rows from a table) can be done by limiting the number of rows you SQL select will return (the syntax differs from SGBD to SGBD). Dom 2012/11/15 jefferyyuan yuanyun...@gmail.com Hi, all: Is there a way to limit returned rows directly in a query string? I know we can limit returned size by parameter: rows, and start, but I am wondering whether we can do this directly in query string , such as: q=(file_type:pdf, rows:10) OR (file_type:ppt, rows:10) We may even add start: q=(file_type:pdf,start:10, rows:10) OR (file_type:ppt, start:10, rows:10) Why I am wanting this function is that, when I try to use DataImportHandler, and want to test its performance, such as fetch 1000, 1 rows. Is it possible to do this in some ways using current solr? Do you think this function is useful? -- View this message in context: http://lucene.472066.n3.nabble.com/Is-there-a-way-to-limit-returned-rows-directly-in-a-query-string-tp4020550.html Sent from the Solr - User mailing list archive at Nabble.com. -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux
Re: Is there a way to limit returned rows directly in a query string?
Wasn't obvious ;). Maybe you could try local params...something like q={!q.op=OR%20rows=3}yourQueryHere Hope this helps Dom 2012/11/15 jefferyyuan yuanyun...@gmail.com Thanks for the reply. I am using SolrEntityProcessor to import data from another remote solr server - not database, so the query here is a solr query. -- View this message in context: http://lucene.472066.n3.nabble.com/Is-there-a-way-to-limit-returned-rows-directly-in-a-query-string-tp4020550p4020565.html Sent from the Solr - User mailing list archive at Nabble.com. -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux
Re: Is there a way to limit returned rows directly in a query string?
First query is OK; it just doesn't fit your need if I understand Could you confirm that the expected result is 6 rows (3 rows w/ppt plus 3 rows/pdf) ? 2012/11/15 jefferyyuan yuanyun...@gmail.com Thanks :) local param is very useful, but seems it doesn't work here: I tried: q={!rows=3}ext_name:pdf OR ext_name:ppt == this only return 3 ppt docs. q={!rows=3}ext_name:pdf OR q={!rows=3}ext_name:ppt This causes syntax error, as solr doesn't support multiple query string. q={!rows=3}ext_name:pdf OR {!rows=3}ext_name:ppt This doesn't work either. -- View this message in context: http://lucene.472066.n3.nabble.com/Is-there-a-way-to-limit-returned-rows-directly-in-a-query-string-tp4020550p4020602.html Sent from the Solr - User mailing list archive at Nabble.com. -- Dominique Debailleux WoAnA - small.but.robust [image: Accèder au profil LinkedIn de Dominique Debailleux]http://www.linkedin.com/in/dominiquedebailleux