lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Schultz <>
Subject How to calculate payloads in queries too
Date Mon, 12 Apr 2010 05:45:18 GMT

I am interested in using payloads in the following way.  I store
Func(index-term) as a payload at index-term when indexing.  When querying I
want to compute Func(query-term) as well.  Then my similarity returns some
other function, Gunc(Func(index-term1),Func(query-term)).

As an example, maybe I'm stripping plural-s and I want to index the singular
along with the payload true/false as to whether the original term was plural
or not.  Then when I query with a term I have a true/false value for it as
well.  My similarity score can then rank plurals higher when plurals are
queried and visa versa.

As another example, say, I have a part of speech tagger and I'm lucky enough
to get long queries that I can also pos tag.

I would think the normal symmetry of query/index would make this usage just
fall out of the code but I only see the use case of index payloads.  I could
hack something so that, for example, I don't use a filter to strip plural s,
and instead do it later in the query object.  Then I could calculate my
Func(query-term) and pass back a similarity that knows about the query
payload.  Is there a better way?
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message