lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1001) Add Payload retrieval to Spans
Date Fri, 21 Nov 2008 02:38:44 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-1001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Miller updated LUCENE-1001:
--------------------------------

    Attachment: LUCENE-1001-fix.patch

Okay, I still understand like 2% of spans, but I think I have fixed the bug.

After finding a match, but before finding a min match, we were pulling the payload - works
fine when the match is the min match, but otherwise we actually have to wait to get the payload
until we have crunched in on the min match. I had an idea of this before, and the code before
I touched it tried to grab the payloads at this point - the problem is, in finding the min
match, you've often advanced passed the term position of interest to find out there was no
such min match. So you have to save the possible payload ahead of time, and either find a
new one or use the possible saved one. Sucks to have to add extra loading, but at the moment
I don't see how to do it differently (I admittedly can't see much in spans). Thats all partly
a guess, partly probably true.

Non the less, this patch handles the previous test cases, plus the bug case reported above.
I have also added a modified version of the given test for the bug to the span battery of
tests.

Thanks Jonathan!

> Add Payload retrieval to Spans
> ------------------------------
>
>                 Key: LUCENE-1001
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1001
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Search
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: LUCENE-1001-fix.patch, LUCENE-1001.patch, LUCENE-1001.patch, LUCENE-1001.patch,
LUCENE-1001.patch, LUCENE-1001.patch, LUCENE-1001.patch, LUCENE-1001.patch, LUCENE-1001.patch
>
>
> 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}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message