Hi, I have been doing more tracing in the code. And I think that I understand a bit more. The problem does not seem to be dismax+join, but dismax+join+fromIndex.
When doing this joined dismax query on the same index: http://localhost:8080/solr/gutenberg/select?q={!join+from=id+to=id+v=$qq}&qq={!dismax+qf='body%20tag ^2'}solr the query returned by the method "fromQueryParser.getQuery" looks like this: +(body:solr | tag:solr^2.0) But when doing the same query across another core: http://localhost:8080/solr/test/select/?q={!join+fromIndex=gutenberg+from=id+to=id+v=$qq}&qq={!dismax+qf='body%20tag ^2'}solr the query is: +(body:solr) We see that the second field defined in the qf param is not added to the query. Tracing deeper shows that this happens because the "tag" field does not exist in the "test" core, hence it is not added. This can be seen in SolrPluginUtils.java in the method getFieldQuery. All the fields not part of the current index won't be added to the query. So the conclusion does not seem to be that dismax can't be used with joins, but that it can't be used with another core that does not have the same fields than the one where the initial query is made. I just notice SOLR-2824. So it is really a bug. I'll take the time to look at the patch attached to this ticket. On Wed, Dec 14, 2011 at 2:55 PM, Pascal Dimassimo < pascal.dimass...@sematext.com> wrote: > Thanks Hoss! > > But unfortunately, the dismax parameters (like qf) are not passed over to > the fromIndex. In fact, even if using var dereferencing makes Dismax to be > selected as the "fromQueryParser", the query that is passed to the > JoinQuery object contains nothing to indicate that it should use dismax. > The following code is from the method createParser in > JoinQParserPlugin.java: > > // With var dereferencing, this makes the fromQueryParser to be dismax > QParser fromQueryParser = subQuery(v, "lucene"); > > // But after the call to getQuery, there is no indication that dismax > should be used > Query fromQuery = fromQueryParser.getQuery(); > JoinQuery jq = new JoinQuery(fromField, toField, fromIndex, fromQuery); > > So I guess that as it is right now, dismax can't really be used with joins. > > On Fri, Dec 9, 2011 at 3:20 PM, Chris Hostetter > <hossman_luc...@fucit.org>wrote: > >> >> : Is there a specific reason why it is hard-coded to use the "lucene" >> : QParser? I was looking at JoinQParserPlugin.java and here it is in >> : createParser: >> : >> : QParser fromQueryParser = subQuery(v, "lucene"); >> : >> : I could pass another param named "fromQueryParser" and use it instead of >> : "lucene". But again, is there a reason why I should not do that? >> >> It's definitley a bug, but we don't need a new local param: that hardcoded >> "lucene" should just be replaced with null, so that the "defType" >> local param will be checked (just like it can in the BoostQParser)... >> >> qf=text name >> q={!join from=manu_id_s to=id defType=dismax}ipod >> >> Note: even with that hardcoded "lucene" bug, you can still override the >> default by using var dereferencing to point at another param with it's own >> localparams specying the type... >> >> qf=text name >> q={!join from=manu_id_s to=id v=$qq} >> qq={!dismax}ipod >> >> -Hoss >> > > > > -- > Pascal Dimassimo > ---- > Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch > Lucene ecosystem search :: http://search-lucene.com/ > > -- Pascal Dimassimo ---- Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch Lucene ecosystem search :: http://search-lucene.com/