You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Christopher Tignor <ct...@thinkmap.com> on 2010/03/05 18:00:54 UTC

Re: recovering payload from fields

What I'd ideally like to do is to take SpanQuery, loop over the PayloadSpans
returned from SpanQuery.getPayloadSpans() and store all PayloadSpans for a
given document in a Map by their doc id.

Then later after deciding in memory which documents I need, load the Payload
data for just those PayloadSpans pulled out of my Map.

But it seems I can't do this as loading Payload data is only done through
the PayloadSpans iterator so must iterate through the entire collection to
get to my PaylaodSpan.  Is there not a way to just save a PayloadSpan and
loads it's payload data later as needed?

thanks,

C>T>

On Sat, Feb 27, 2010 at 5:42 AM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> You can also access payloads through the TermPositions enum, but, this
> is by term and then by doc.
>
> It sounds like you need to iterate through all terms sequentially in a
> given field in the doc, accessing offset & payload?  In which case
> reanalyzing at search time may be the best way to go.
>
> You can store term vectors in the index, which will store offsets (if
> you ask it to), but, payloads are not currently stored with term
> vectors.
>
> Mike
>
> On Fri, Feb 26, 2010 at 7:42 PM, Christopher Condit <co...@sdsc.edu>
> wrote:
> >> Payload Data is accessed through PayloadSpans so using SpanQUeries is
> the
> >> netry point it seems.  There are tools like PayloadSpanUtil that convert
> other
> >> queries into SpanQueries for this purpose if needed but the api for
> Payloads
> >> looks it like it goes through Spans is the bottom line.
> >
> > So there's no way to iterate through all the payloads for a given field?
> I can't use the SpanQuery mechanism because in this case the entire field
> will be displayed - and I can't search for "*". Is there some trick I'm not
> thinking of?
> >
> >> this is the tip of the iceberg; a big dangerous iceberg...
> >
> > Yes - I'm beginning to see that...
> >
> > Thanks,
> > -Chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
TH!NKMAP

Christopher Tignor | Senior Software Architect
155 Spring Street NY, NY 10012
p.212-285-8600 x385 f.212-285-8999