lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David vandendriessche (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4043) Add scoring support for query time join
Date Mon, 21 Jan 2013 11:00:13 GMT


David vandendriessche commented on LUCENE-4043:

Update on my code:

public class TestParserPlugin extends QParserPlugin {

    public QParser createParser(String string, SolrParams sp, SolrParams sp1, SolrQueryRequest
sqr) {
        return new TestParser(string, sp1, sp1, sqr);


    public void init(NamedList nl) {

    public class TestParser extends QParser {

        public TestParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest
req) {
            super(qstr, localParams, params, req);

        public parse() throws org.apache.lucene.queryparser.classic.ParseException

            IndexReader reader;
            try {
                reader = File("C:\\java\\apache-solr-4.0.0\\apache-solr-4.0.0\\example\\solr\\BookCore\\data\\index")));

                IndexSearcher searcher = new IndexSearcher(reader);
                BooleanQuery fromQuery = new BooleanQuery();
                fromQuery.add(new TermQuery(new Term("pageTxt", "crazy")), BooleanClause.Occur.MUST);
                fromQuery.add(new TermQuery(new Term("pageTxt", "test")), BooleanClause.Occur.SHOULD);
                return JoinUtil.createJoinQuery("pageId", true, "fileId",fromQuery, searcher,
            } catch (IOException ex) {
                Logger.getLogger(TestParserPlugin.class.getName()).log(Level.SEVERE, null,
            return null;

I still have 2 questions concerning this code:
Is there a way to get the searcher instead of opening from fs everytime I use this plugin?
Is it possible to combine this qparser with edismax etc in stead of building queries using
occur.must etc...
> Add scoring support for query time join
> ---------------------------------------
>                 Key: LUCENE-4043
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/join
>            Reporter: Martijn van Groningen
>             Fix For: 4.0-ALPHA
>         Attachments: LUCENE-4043.patch, LUCENE-4043.patch, LUCENE-4043.patch, LUCENE-4043.patch
> Have similar scoring for query time joining just like the index time block join (with
the score mode).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message