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 NearSpansOrdered and NearSpansUnordered classes, which are not public. I'd be content to be able to get the payload from just the first term of the span.
Can anyone suggest an approach for making payloads work with SpanNearQuery? Peter On 6/27/07, Grant Ingersoll <[EMAIL PROTECTED]> wrote:
Could you get what you need combining the BoostingTermQuery with a SpanNearQuery to produce a score? Just guessing here.. At some point, I would like to see more Query classes around the payload stuff, so please submit patches/feedback if and when you get a solution On Jun 27, 2007, at 10:45 AM, Peter Keegan wrote: > I'm looking at the new Payload api and would like to use it in the > following > manner. Meta-data is indexed as a special phrase (all terms at same > position) and a payload is stored with the first term of each > phrase. I > would like to create a custom query class that extends PhraseQuery > and uses > its PhraseScorer to find matching documents. The custom query class > then > reads the payload from the first term of the matching query and > uses it to > produce a new score. However, I don't see how to get the payload > from the > PhraseScorer's TermPositions. Is this possible? > > > Peter -------------------------- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]