lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furkan KAMACI <>
Subject Using Payloads as a Coefficient For Score At a Custom QParser That extends ExtendedDismaxQParser
Date Sun, 01 Dec 2013 16:49:54 GMT

I use Solr 4.5.1 I have a case: When a user searches for some specific
keywords some documents should be listed at much more higher than its usual
score. I mean I have probabilities of which documents user may want to see
for given keywords.

I have come up with that idea. I can put a new field to my schema. This
field holds keyword and probability as payload. When a user searches for a
keyword I will calculate usual document score for given fields and also I
will make a search on payloaded field and I will multiply the total score
with that payload.

I followed that example:! However
that example extends Qparser directly but I want to use capabilities of

So I found that example:
one exteds dismax and but I could not used payloads at that example.

I want to combine above to solutions. First solution has that case:

    public Similarity get(String name) {
        if ("payloads".equals(name) || "cscores".equals(name)) {
            return new PayloadSimilarity();
        } else {
            return new DefaultSimilarity();

However dismax behaves different. i.e. when you search for cscores:A it
changes that into that:

+((text:cscores:y text:cscores text:y text:cscoresy)) ()

When I debug it name is *text *instead of *cscores *and does not work. My
idea is combining two examples and extending *edismax*. Do you have any
idea how to extend it for edismax or do you have any idea what to do for my


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