Your join is requesting to use the "join_id" field ("from") of documents matching the query of "cor_parede:branca", but the join_id field of that document is empty.

Maybe you intended to search in the other direction, like "acessorio1:Teclado".

-- Jack Krupansky

-----Original Message----- From: Marcelo Elias Del Valle
Sent: Tuesday, July 09, 2013 7:34 PM
To: solr-user@lucene.apache.org
Subject: join not working with UUIDs

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

Reply via email to