Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7957

Allow multiple queries per request and simplify ResultContext / TransformContext

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: search
    • Labels:
      None

      Description

      Today we have a ResultContext which simply has two public variables query and docList. For writing a response, those fields are used to create a DocsStreamer which creates a TransformContext for transformers (which just copies the values like searcher, req, q, etc again).

      It seems the all the methods on TransformContext could be simply moved to ResultContext.

      Only exception is "iterator" needed by ScoreAugmenter, but we could simply pass down the score in the transform() method as well.

      This would result in a ResultContext that could do things like support multiple queries with different return fields, and things like returning a list of docs from another core (think cross-core join).

      1. SOLR-7957.patch
        44 kB
        Yonik Seeley

        Activity

        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        OK, here's a patch that puts enough info into ResultContext to allow for multiple queries per request. Since the ResultContext carries all of the info that was previously in TransformContext, the latter was redundant and hence was removed.

        ResponseWriters now ask for an iterator over the results from the ResultContext itself, expanding future options (as opposed to hard-coding DocStreamer).

        This doesn't address all of the issues with transformers, etc... we don't have a good answer for transformers that would benefit from batching, and transformers aren't thread safe (they can't be used concurrently in different threads). But I think allowing multiple queries per request is a good start.

        Show
        yseeley@gmail.com Yonik Seeley added a comment - OK, here's a patch that puts enough info into ResultContext to allow for multiple queries per request. Since the ResultContext carries all of the info that was previously in TransformContext, the latter was redundant and hence was removed. ResponseWriters now ask for an iterator over the results from the ResultContext itself, expanding future options (as opposed to hard-coding DocStreamer). This doesn't address all of the issues with transformers, etc... we don't have a good answer for transformers that would benefit from batching, and transformers aren't thread safe (they can't be used concurrently in different threads). But I think allowing multiple queries per request is a good start.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1698421 from Yonik Seeley in branch 'dev/trunk'
        [ https://svn.apache.org/r1698421 ]

        SOLR-7957: expand ResultContext to allow for multiple DocLists per response, remove redundant TransformContext

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1698421 from Yonik Seeley in branch 'dev/trunk' [ https://svn.apache.org/r1698421 ] SOLR-7957 : expand ResultContext to allow for multiple DocLists per response, remove redundant TransformContext
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1698442 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1698442 ]

        SOLR-7957: Fix javadoc error causing precommit to fail

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1698442 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1698442 ] SOLR-7957 : Fix javadoc error causing precommit to fail
        Hide
        erickerickson Erick Erickson added a comment -

        OK, never mind my previous noise. But the questions still remain:
        1> should this be merged into 5x?
        2> can it be closed?

        Show
        erickerickson Erick Erickson added a comment - OK, never mind my previous noise. But the questions still remain: 1> should this be merged into 5x? 2> can it be closed?
        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        I only committed these changes to trunk because they changed/removed public interfaces that would reasonably be used by certain plugins.

        Show
        yseeley@gmail.com Yonik Seeley added a comment - I only committed these changes to trunk because they changed/removed public interfaces that would reasonably be used by certain plugins.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 489f386b766882d717d1bf5f740b81c179084d0e in lucene-solr's branch refs/heads/branch_5_5 from Steve Rowe
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=489f386 ]

        SOLR-8902: don't try to pull return fields from the ResultContext - this method, added in SOLR-7957, won't be backported to 5.x

        Show
        jira-bot ASF subversion and git services added a comment - Commit 489f386b766882d717d1bf5f740b81c179084d0e in lucene-solr's branch refs/heads/branch_5_5 from Steve Rowe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=489f386 ] SOLR-8902 : don't try to pull return fields from the ResultContext - this method, added in SOLR-7957 , won't be backported to 5.x
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0442aa5e5eca3a688fa1aa47b26d2f1aeaa5c994 in lucene-solr's branch refs/heads/branch_5x from Steve Rowe
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0442aa5 ]

        SOLR-8902: don't try to pull return fields from the ResultContext - this method, added in SOLR-7957, won't be backported to 5.x

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0442aa5e5eca3a688fa1aa47b26d2f1aeaa5c994 in lucene-solr's branch refs/heads/branch_5x from Steve Rowe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0442aa5 ] SOLR-8902 : don't try to pull return fields from the ResultContext - this method, added in SOLR-7957 , won't be backported to 5.x

          People

          • Assignee:
            yseeley@gmail.com Yonik Seeley
            Reporter:
            yseeley@gmail.com Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development