What kind of field is root_id? If it's tokenized or not the same type as id, that could account for it.
Best Erick On Tue, Jul 9, 2013 at 7:34 PM, Marcelo Elias Del Valle <mvall...@gmail.com> wrote: > Hello, > > I am trying to create a POC to test query joins. However, I was > surprised when I saw my test worked with some ids, but when my document ids > are UUIDs, it doesn't work. > Follows an example, using solrj: > > SolrInputDocument doc = new SolrInputDocument(); > doc.addField("id", "bcbaf9eb-0da7-4225-be24-2b9472ad2c20"); > doc.addField("cor_parede", "branca"); > doc.addField("num_cadeiras", 34); > solr.add(doc); > > // Add children > SolrInputDocument doc2 = new SolrInputDocument(); > doc2.addField("id", "computador1"); > doc2.addField("acessorio1", "Teclado"); > doc2.addField("acessorio2", "Mouse"); > doc2.addField("root_id", "bcbaf9eb-0da7-4225-be24-2b9472ad2c20"); > solr.add(doc2); > > When I execute: > > ///select > params={start=0&rows=10&q=cor_parede%3Abranca&fq=%7B%21join+from%3Droot_id+to%3Did%7Dacessorio1%3ATeclado} > SolrQuery query = new SolrQuery(); > > query.setStart(0); > query.setRows(10); > query.set("q", "cor_parede:branca"); > query.set("fq", "{!join from=root_id to=id}acessorio1:Teclado"); > > QueryResponse response = DGSolrServer.get().query(query); > long numFound = response.getResults().getNumFound(); > > it returns zero results. However, if I use "room1" for first > document's id and for root_id field on second document, it works. > > Any idea why? What am I missing? > > Best regards, > -- > Marcelo Elias Del Valle > http://mvalle.com - @mvallebr