FAQ
Hi,
I want to customize a new Similarity class which need to adopt payload information.The current definition of scorePayload is below:
"public float scorePayload(String fieldName, byte [] payload, int offset, int length)"
I have a problem when using this function.In case we have two BoostingTermQuery:
BoostingTermQuery #1: fieldName="Country" and fieldValue= "America"
BoostingTermQuery #2: fieldName="Country" and fieldValue="China"
and the the information of one payloads looks like this:
payload: {new York,san Jose,Chicago}
of course,query #1 should get a higher payPayload score.But current interface prevent us from sending fieldValue information to scorePayload function. So maybe we should add a new interface like
public float scorePayload(String fielName,String value,byte[] payload,int offset,int length)
and Boosting Query also need to be changed accordingly.

Thanks
-Qi

Search Discussions

  • Grant Ingersoll at Jun 24, 2008 at 7:30 pm
    Not sure, but would a CustomScoreQuery (or an extension of it) work
    for you? This way, you could try to combine the BoostingTermQuery
    with a ValueSourceQuery (i.e. FunctionQuery)

    Another option is to just extend BoostingTermQuery and implement your
    own scorer that takes into account the field.

    Of course, that isn't to say your idea is wrong. We could add the
    method and add a new Payload Query that calls it, or just change it
    all together. Of course, things may change, too, if and when we want
    to do things like add payload phrase queries. A patch would be good.

    Just trying to brainstorm some alternatives that don't involve API
    changes.
    On Jun 24, 2008, at 12:16 PM, wuqi wrote:

    Hi,
    I want to customize a new Similarity class which need to adopt
    payload information.The current definition of scorePayload is below:
    "public float scorePayload(String fieldName, byte [] payload, int
    offset, int length)"
    I have a problem when using this function.In case we have two
    BoostingTermQuery:
    BoostingTermQuery #1: fieldName="Country" and fieldValue=
    "America"
    BoostingTermQuery #2: fieldName="Country" and fieldValue="China"
    and the the information of one payloads looks like this:
    payload: {new York,san Jose,Chicago}
    of course,query #1 should get a higher payPayload score.But current
    interface prevent us from sending fieldValue information to
    scorePayload function. So maybe we should add a new interface like
    public float scorePayload(String fielName,String value,byte[]
    payload,int offset,int length)
    and Boosting Query also need to be changed accordingly.

    Thanks
    -Qi

    --------------------------
    Grant Ingersoll
    http://www.lucidimagination.com

    Lucene Helpful Hints:
    http://wiki.apache.org/lucene-java/BasicsOfPerformance
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 24, '08 at 4:22p
activeJun 24, '08 at 7:30p
posts2
users2
websitelucene.apache.org

2 users in discussion

Wuqi: 1 post Grant Ingersoll: 1 post

People

Translate

site design / logo © 2022 Grokbase