Issue Details (XML | Word | Printable)

Key: LUCENE-1001
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Grant Ingersoll
Reporter: Grant Ingersoll
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

Add Payload retrieval to Spans

Created: 16/Sep/07 02:48 AM   Updated: 21/Nov/08 09:46 PM
Return to search
Component/s: Search
Affects Version/s: None
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1001-fix.patch 2008-11-21 02:37 AM Mark Miller 7 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2008-08-19 09:43 PM Mark Miller 56 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2008-08-19 02:39 PM Grant Ingersoll 58 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2008-08-11 08:56 PM Mark Miller 55 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2008-08-11 01:22 AM Mark Miller 55 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2008-08-10 03:47 AM Mark Miller 46 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2008-08-09 05:02 PM Mark Miller 43 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2007-11-26 02:26 PM Grant Ingersoll 44 kB
Text File Licensed for inclusion in ASF works LUCENE-1001.patch 2007-11-25 05:52 PM Grant Ingersoll 43 kB
Issue Links:
Reference
 

Lucene Fields: Patch Available
Resolution Date: 20/Aug/08 04:07 PM


 Description  « Hide
It will be nice to have access to payloads when doing SpanQuerys.

See http://www.gossamer-threads.com/lists/lucene/java-dev/52270 and http://www.gossamer-threads.com/lists/lucene/java-dev/51134

Current API, added to Spans.java is below. I will try to post a patch as soon as I can figure out how to make it work for unordered spans (I believe I have all the other cases working).

 /**
   * Returns the payload data for the current span.
   * This is invalid until {@link #next()} is called for
   * the first time.
   * This method must not be called more than once after each call
   * of {@link #next()}. However, payloads are loaded lazily,
   * so if the payload data for the current position is not needed,
   * this method may not be called at all for performance reasons.<br>
   * <br>
   * <p><font color="#FF0000">
   * WARNING: The status of the <b>Payloads</b> feature is experimental.
   * The APIs introduced here might change in the future and will not be
   * supported anymore in such a case.</font>
   *
   * @return a List of byte arrays containing the data of this payload
   * @throws IOException
   */
  // TODO: Remove warning after API has been finalized
  List/*<byte[]>*/ getPayload() throws IOException;

  /**
   * Checks if a payload can be loaded at this position.
   * <p/>
   * Payloads can only be loaded once per call to
   * {@link #next()}.
   * <p/>
   * <p><font color="#FF0000">
   * WARNING: The status of the <b>Payloads</b> feature is experimental.
   * The APIs introduced here might change in the future and will not be
   * supported anymore in such a case.</font>
   *
   * @return true if there is a payload available at this position that can be loaded
   */
  // TODO: Remove warning after API has been finalized
  public boolean isPayloadAvailable();


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Grant Ingersoll made changes - 16/Sep/07 12:05 PM
Field Original Value New Value
Description It will be nice to have access to payloads when doing SpanQuerys.

See http://www.gossamer-threads.com/lists/lucene/java-dev/52270 and http://www.gossamer-threads.com/lists/lucene/java-dev/51134

Current API, added to Spans.java is below. I will try to post a patch as soon as I can figure out how to make it work for unordered spans (I believe I have all the other cases working).


 /**
   * Returns the payload data for the current span.
   * This is invalid until {@link #next()} is called for
   * the first time.
   * This method must not be called more than once after each call
   * of {@link #next()}. However, payloads are loaded lazily,
   * so if the payload data for the current position is not needed,
   * this method may not be called at all for performance reasons.<br>
   * <br>
   * <p><font color="#FF0000">
   * WARNING: The status of the <b>Payloads</b> feature is experimental.
   * The APIs introduced here might change in the future and will not be
   * supported anymore in such a case.</font>
   *
   * @return a List of byte arrays containing the data of this payload
   * @throws IOException
   */
  // TODO: Remove warning after API has been finalized
  List/*<byte[]>*/ getPayload() throws IOException;

  /**
   * Checks if a payload can be loaded at this position.
   * <p/>
   * Payloads can only be loaded once per call to
   * {@link #next()}.
   * <p/>
   * <p><font color="#FF0000">
   * WARNING: The status of the <b>Payloads</b> feature is experimental.
   * The APIs introduced here might change in the future and will not be
   * supported anymore in such a case.</font>
   *
   * @return true if there is a payload available at this position that can be loaded
   */
  // TODO: Remove warning after API has been finalized
  public boolean isPayloadAvailable();
It will be nice to have access to payloads when doing SpanQuerys.

See http://www.gossamer-threads.com/lists/lucene/java-dev/52270 and http://www.gossamer-threads.com/lists/lucene/java-dev/51134

Current API, added to Spans.java is below. I will try to post a patch as soon as I can figure out how to make it work for unordered spans (I believe I have all the other cases working).

{noformat}
 /**
   * Returns the payload data for the current span.
   * This is invalid until {@link #next()} is called for
   * the first time.
   * This method must not be called more than once after each call
   * of {@link #next()}. However, payloads are loaded lazily,
   * so if the payload data for the current position is not needed,
   * this method may not be called at all for performance reasons.<br>
   * <br>
   * <p><font color="#FF0000">
   * WARNING: The status of the <b>Payloads</b> feature is experimental.
   * The APIs introduced here might change in the future and will not be
   * supported anymore in such a case.</font>
   *
   * @return a List of byte arrays containing the data of this payload
   * @throws IOException
   */
  // TODO: Remove warning after API has been finalized
  List/*<byte[]>*/ getPayload() throws IOException;

  /**
   * Checks if a payload can be loaded at this position.
   * <p/>
   * Payloads can only be loaded once per call to
   * {@link #next()}.
   * <p/>
   * <p><font color="#FF0000">
   * WARNING: The status of the <b>Payloads</b> feature is experimental.
   * The APIs introduced here might change in the future and will not be
   * supported anymore in such a case.</font>
   *
   * @return true if there is a payload available at this position that can be loaded
   */
  // TODO: Remove warning after API has been finalized
  public boolean isPayloadAvailable();
{noformat}
Grant Ingersoll made changes - 20/Nov/07 03:00 PM
Status Open [ 1 ] In Progress [ 3 ]
Paul Elschot made changes - 20/Nov/07 11:11 PM
Comment [ Grant,

You asked:

... how do I get access to the position payloads in the order that they occur
in the PQ?

The answer was already there:

... , it's easier than that: when they match, they all match, so you only need
to keep the input Spans around in List or whatever. Then use them all as a
source for your payloads.

Regards,
Paul Elschot

P.S. I've had my break already...
]
Grant Ingersoll made changes - 25/Nov/07 02:20 PM
Fix Version/s 2.3 [ 12312531 ]
Grant Ingersoll made changes - 25/Nov/07 05:52 PM
Attachment LUCENE-1001.patch [ 12370162 ]
Grant Ingersoll made changes - 26/Nov/07 02:26 PM
Attachment LUCENE-1001.patch [ 12370204 ]
Grant Ingersoll made changes - 06/Dec/07 03:31 AM
Fix Version/s 2.3 [ 12312531 ]
Fix Version/s 2.4 [ 12312681 ]
Jonathan Mamou made changes - 01/May/08 12:29 PM
Comment [ Is this patch also compatible with Lucene 2.3.1? ]
Mark Miller made changes - 09/Aug/08 04:57 PM
Attachment LUCENE-1001.patch [ 12387880 ]
Mark Miller made changes - 09/Aug/08 05:01 PM
Attachment LUCENE-1001.patch [ 12387880 ]
Mark Miller made changes - 09/Aug/08 05:02 PM
Attachment LUCENE-1001.patch [ 12387881 ]
Mark Miller made changes - 10/Aug/08 03:47 AM
Attachment LUCENE-1001.patch [ 12387894 ]
Mark Miller made changes - 11/Aug/08 01:22 AM
Attachment LUCENE-1001.patch [ 12387916 ]
Mark Miller made changes - 11/Aug/08 08:56 PM
Attachment LUCENE-1001.patch [ 12387993 ]
Grant Ingersoll made changes - 19/Aug/08 02:39 PM
Attachment LUCENE-1001.patch [ 12388532 ]
Mark Miller made changes - 19/Aug/08 09:43 PM
Attachment LUCENE-1001.patch [ 12388564 ]
Grant Ingersoll made changes - 20/Aug/08 04:07 PM
Resolution Fixed [ 1 ]
Lucene Fields [New] [Patch Available]
Status In Progress [ 3 ] Resolved [ 5 ]
Michael McCandless made changes - 11/Oct/08 12:49 PM
Status Resolved [ 5 ] Closed [ 6 ]
Mark Miller made changes - 21/Nov/08 02:37 AM
Attachment LUCENE-1001-fix.patch [ 12394394 ]
Mark Miller made changes - 21/Nov/08 09:46 PM
Link This issue is related to LUCENE-1465 [ LUCENE-1465 ]