On Fri, Sep 30, 2011 at 11:32 AM, Jason Toy <jason...@gmail.com> wrote: > I'm testing out the join functionality on the svn revision 1175424. > I've found when I add a single filter query to a join it works fine, but > when I do more then 1 filter query, the query does not return results. > This single function query with a join returns results: > > http://127.0.0.1:8983/solr/select?fq=state_s:California&q={!join+from%3Dself_id_i+to%3Duser_id_i}all_posts_text:%22lucene%22 > > This other single function query with a join returns the same results: > http://127.0.0.1:8983/solr/select?fq=data_text:solr&q={!join+from%3Dself_id_i+to%3Duser_id_i}all_posts_text:%22lucene%22 > > when I combine them there are no results: > > http://127.0.0.1:8983/solr/select?fq=data_text:solr&fq=state_s:California&q={!join+from%3Dself_id_i+to%3Duser_id_i}all_posts_text:%22lucene%22 > > I think I see where the issue possibly is. > > I have 2 kinds of docs, User, and Post. > > User has the fields: > > all_posts_text > > state_s > > self_id_i > > Post has the fields > > user_id > > data_text > > Of the 2 filter queries I have, each one is filtering on a different doc > type, state_s:California is filtering on User and data_text:solr is > filtering on Post. How do I tell solr which docs the filters are supposed > to be applied, before or after the join.
The join results in only "Post" type documents, so the intersection with fq=state_s:California (which only appears on "User" type documents) should always give back 0 documents. You need to apply that filter before the join translates between these two document types. {!join from=self_id_i to=user_id_i}all_posts_text:"lucene" +state_s:California -Yonik http://www.lucene-eurocon.com - The Lucene/Solr User Conference