Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-1028

Weight is not serializable for some of the queries

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      Patch Available

      Description

      In order to work with ParallelMultiSearcher, Query weights need to be serializable. The interface Weight extends java.io.Serializable, but it appears that some of the newer queries unnecessarily store global state in their weights, thus causing serialization errors.

      1. lucene-serialization.diff
        4 kB
        Kyle Maxwell
      2. lucene-serialization.diff
        12 kB
        Doron Cohen

        Activity

        Hide
        doronc Doron Cohen added a comment -

        Just committed this fix.
        Thanks Kyle!

        Show
        doronc Doron Cohen added a comment - Just committed this fix. Thanks Kyle!
        Hide
        doronc Doron Cohen added a comment -

        Updated patch contains:

        • Kyle's fixes for search.function weights.
        • serialization test as part of standard queries tests,
        • fix for DisjunctionMaxQuery and for few tests.
        Show
        doronc Doron Cohen added a comment - Updated patch contains: Kyle's fixes for search.function weights. serialization test as part of standard queries tests, fix for DisjunctionMaxQuery and for few tests.
        Hide
        doronc Doron Cohen added a comment - - edited

        Correction - BoostingTermQuery is ok, but TestBTQ had to be modified for the serialization test to pass.
        DisjunctionMaxQuery had problems similar to CustomScoreQuery.

        Show
        doronc Doron Cohen added a comment - - edited Correction - BoostingTermQuery is ok, but TestBTQ had to be modified for the serialization test to pass. DisjunctionMaxQuery had problems similar to CustomScoreQuery.
        Hide
        doronc Doron Cohen added a comment -

        Thanks for catching this Kyle.
        Patch looks good to me and working.
        I enhanced checkQuery() in test/a.o.l.search.QueryUtils to check all queries for serialization.
        This catches this bug and verifies the fix.
        It also shows that BoostingTermQuery fails fr this check, but I am not sure why.

        Show
        doronc Doron Cohen added a comment - Thanks for catching this Kyle. Patch looks good to me and working. I enhanced checkQuery() in test/a.o.l.search.QueryUtils to check all queries for serialization. This catches this bug and verifies the fix. It also shows that BoostingTermQuery fails fr this check, but I am not sure why.

          People

          • Assignee:
            doronc Doron Cohen
            Reporter:
            fizx Kyle Maxwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development