Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: modules/analysis
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      We want to make some optimizations to the Payloads API.

      See following thread for related discussions:
      http://www.gossamer-threads.com/lists/lucene/java-dev/54708

      1. lucene-1062.patch
        10 kB
        Michael Busch
      2. lucene-1062.patch
        13 kB
        Michael Busch

        Activity

        Hide
        michaelbusch Michael Busch added a comment -

        Committed.

        Show
        michaelbusch Michael Busch added a comment - Committed.
        Hide
        michaelbusch Michael Busch added a comment -

        Thanks for reviewing! OK, I'll add that to the javadocs
        and commit it then.

        Show
        michaelbusch Michael Busch added a comment - Thanks for reviewing! OK, I'll add that to the javadocs and commit it then.
        Hide
        mikemccand Michael McCandless added a comment -

        Patch looks good!

        Maybe note in the javadoc for Payload ctor & setData that a
        reference is held to the provided array (no copy is made)?

        Show
        mikemccand Michael McCandless added a comment - Patch looks good! Maybe note in the javadoc for Payload ctor & setData that a reference is held to the provided array (no copy is made)?
        Hide
        michaelbusch Michael Busch added a comment -

        I agree, Doron. You proposed method names are better.

        OK, I changed the method names in this patch and also
        made the no-arg constructor of Payload public.

        All tests pass. I'm planning to commit this soon.

        Show
        michaelbusch Michael Busch added a comment - I agree, Doron. You proposed method names are better. OK, I changed the method names in this patch and also made the no-arg constructor of Payload public. All tests pass. I'm planning to commit this soon.
        Hide
        doronc Doron Cohen added a comment -

        I find Payload.getPayload() a bit confusing - how about renaming Payload methods from:
        setPayload(byte[] data), setPayload(byte data[], int offset, int length), getPayload()
        to:
        setData(byte[] data), setData(byte data[], int offset, int length), getData()

        Show
        doronc Doron Cohen added a comment - I find Payload.getPayload() a bit confusing - how about renaming Payload methods from: setPayload(byte[] data), setPayload(byte data[], int offset, int length), getPayload() to: setData(byte[] data), setData(byte data[], int offset, int length), getData()
        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        setPayload(null) seems fine to remove a payload.

        Show
        yseeley@gmail.com Yonik Seeley added a comment - setPayload(null) seems fine to remove a payload.
        Hide
        michaelbusch Michael Busch added a comment -

        In case a filter wants to remove a Payload from a Token,
        shall we offer a method like clearPayload(), or is
        setPayload(null) good enough?

        Show
        michaelbusch Michael Busch added a comment - In case a filter wants to remove a Payload from a Token, shall we offer a method like clearPayload(), or is setPayload(null) good enough?
        Hide
        michaelbusch Michael Busch added a comment -

        Patch that contains all changes mentioned above.

        Show
        michaelbusch Michael Busch added a comment - Patch that contains all changes mentioned above.
        Hide
        michaelbusch Michael Busch added a comment -

        We want to add the following methods to Payload:

        public void setPayload(byte[] data);
        public void setPayload(byte[] data, int offset, int length);
        public byte[] getPayload();
        public int getPayloadOffset();
        
        public Object clone();
        

        Also Payload should implement Cloneable.

        Furthermore, we want to add a fieldName arg to Similarity.scorePayload().

        I think we can also remove the "experimental" warnings from the Payload
        APIs now?

        Show
        michaelbusch Michael Busch added a comment - We want to add the following methods to Payload: public void setPayload( byte [] data); public void setPayload( byte [] data, int offset, int length); public byte [] getPayload(); public int getPayloadOffset(); public Object clone(); Also Payload should implement Cloneable. Furthermore, we want to add a fieldName arg to Similarity.scorePayload(). I think we can also remove the "experimental" warnings from the Payload APIs now?

          People

          • Assignee:
            michaelbusch Michael Busch
            Reporter:
            michaelbusch Michael Busch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development