lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Keegan" <peterlkee...@gmail.com>
Subject Re: Payloads and PhraseQuery
Date Thu, 12 Jul 2007 19:59:02 GMT
Grant,

If/when you have an implementation for SpanNearQuery, I'd be happy to test
it.

Peter

On 7/12/07, Grant Ingersoll <grant.ingersoll@gmail.com> wrote:
>
> Yep, totally agree.    One way to handle this initially at least is
> have isPayloadAvailable() only return true for the SpanTermQuery.
> The other option is to come up with some modification of the
> suggested methods below to return all the payloads in a span.
>
> I have a basic implementation for just the SpanTermQuery (i.e. via
> TermSpans) in the works.  I will take a crack at fleshing out the
> rest at some point soon.
>
> -Grant
>
> On Jul 12, 2007, at 1:22 PM, Paul Elschot wrote:
>
> >
> > On Thursday 12 July 2007 14:50, Grant Ingersoll wrote:
> >> That is off of the TermSpans class.  BTQ (BoostingTermQuery) is
> >> implemented to extend SpanQuery, thus SpanNearQuery isn't, w/o
> >> modification, going to have access to these things.  However, if you
> >> look at the SpanTermQuery, you will see that it's implementation of
> >> Spans is indeed the TermSpans class.  So, I think you could cast to
> >> it or handle it through instanceof.
> >>
> >> I am not completely sure here, but it seems like we may need an
> >> efficient way to access the TermPositions for each document.  That
> >> is, the Spans class doesn't provide this and maybe it should
> >> somehow.  Again, I am just thinking out loud here.
> >
> > SpanQueries can be nested, so the relationship between a span
> > and a term position can also be one to many, not only one to one.
> > For example a matching span in the Spans of a SpanNearQuery
> > can be based on two matching (near enough to match) term positions.
> >
> >>
> >> Thus, if we modified Spans to have the following methods:
> >>
> >> byte[] getPayload(byte[] data, int offset)
> >>
> >> boolean isPayloadAvailable()
> >>
> >> I think this would be useful.  Perhaps this should be discussed on
> >> dev.
> >
> > And the same holds for the payloads, there many be more than one
> > for a single Span.
> >
> > Regards,
> > Paul Elschot
> >
> >>
> >> Cheers,
> >> Grant
> >>
> >>
> >> On Jul 12, 2007, at 8:20 AM, Peter Keegan wrote:
> >>
> >>> I'm looking for Spans.getPositions(), as shown in
> >>> BoostingTermQuery, but
> >>> neither NearSpansOrdered nor NearSpansUnordered (which are the Spans
> >>> provided by SpanNearQuery) provide this method and it's not clear
> >>> to me how
> >>> to add it.
> >>>
> >>> Peter
> >>>
> >>> On 7/11/07, Chris Hostetter <hossman_lucene@fucit.org> wrote:
> >>>>
> >>>>
> >>>> : I'm now looking at using payloads with SpanNearQuery but I don't
> >>>> see any
> >>>> : clear way of getting the payload(s) from the matching span
> >>>> terms. The
> >>>> term
> >>>> : positions for the payloads seem to be buried beneath SpanCells
> >>>> in the
> >>>>
> >>>> Isn't Spans.start() and Spans.end() what you are looking for?
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> -Hoss
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> --
> >>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >>>> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>>>
> >>>>
> >>
> >> --------------------------
> >> Grant Ingersoll
> >> Center for Natural Language Processing
> >> http://www.cnlp.org/tech/lucene.asp
> >>
> >> Read the Lucene Java FAQ at http://wiki.apache.org/lucene-java/
> >> LuceneFAQ
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
>
> ------------------------------------------------------
> Grant Ingersoll
> http://www.grantingersoll.com/
> http://lucene.grantingersoll.com
> http://www.paperoftheweek.com/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message