Thanks for your response Mary.

We've already looked at the relevance trace and it didn't tell us anything
useful. The relevant item either appears in the trace and contributes to
the score, or it doesn't.

I don't think it's specific to our data - I my original post I gave an
example that demonstrates this effect in a database containing only 3
documents and a single range index.

Chris

On 10 November 2015 at 16:42, Mary Holstege <mary.holst...@marklogic.com>
wrote:

> On Tue, 10 Nov 2015 02:20:38 -0800, Chris Rimmer <
> chris.rim...@67bricks.com> wrote:
>
> Does anyone have an idea about this issue? It seems like a bug to me.
>>
>
> I would look at the relevance trace information. There is a lot of
> bucketing and caps involved in score calculations, and it could just be
> that for your query and your data the 0.5 is getting lost in the noise.
>
> Add <search-option>relevance-trace</search-option> to your options, and
> you'll get additional information about how the scoring is calculated.
>
> //Mary
>
>
>
>> On 30 October 2015 at 10:51, Chris Rimmer <chris.rim...@67bricks.com>
>> wrote:
>>
>> Hi,
>>
>>
>> We are running MarkLogic 8.0-3 and using the "additional query" technique
>> to
>> influence the ordering of search results (as discussed here
>> http://markmail.org/message/cmxhjxd77clicsbz).
>> While this is mostly working, we have found that when the "boosting
>> queries" are
>> specified with weights less than 0.5, they have no influence on the score
>> at all.
>> The relevant documentation (
>> https://docs.marklogic.com/guide/search-dev/relevance#id_22791)
>> says "To lower the score contribution, set the weight between 0 and 1.0".
>> There
>> is no suggestion that any value less than 0.5 is effectively zero.
>>
>>
>> As as an example, given an empty database with an element range index set
>> up on
>> the element "name" as follows:
>>
>>
>> import module namespace admin = "http://marklogic.com/xdmp/admin"; at
>> "/MarkLogic/admin.xqy";
>>
>>
>> let $dbid := xdmp:database("Documents")
>>
>> let $config := admin:get-configuration()
>>
>> let $rangespec := admin:database-range-element-index("string", "",
>> "name", "http://marklogic.com/collation/";,
>> fn:false() )
>>
>> let $new-config := admin:database-add-range-element-index($config, $dbid,
>> $rangespec)
>>
>> return admin:save-configuration($new-config)
>>
>>
>> Running the following with the weight set to 0.5 will show that the "Bob"
>> document is indeed scored higher than the others, while when this is set
>> to 0.49,
>> all the documents come out with the same weight:
>>
>>
>> import module namespace search = "http://marklogic.com/appservices/search";
>> at "/MarkLogic/appservices/search/search.xqy";
>>
>>
>> let $weight := 0.5
>>
>>
>> let $_ := xdmp:document-insert("/alf",
>> <person><name>Alf</name><role>Blah</role></person>)
>>
>> let $_ := xdmp:document-insert("/bob",
>> <person><name>Bob</name><role>Blah</role></person>)
>>
>> let $_ := xdmp:document-insert("/cal",
>> <person><name>Cal</name><role>Blah</role></person>)
>>
>>
>> let $or-query := cts:or-query((
>>
>> cts:and-query(()),
>>
>> cts:element-range-query(xs:QName("name"), "=", "Bob",
>> ("score-function=linear"),
>> $weight)
>>
>> ))
>>
>>
>> let $options := <options xmlns="http://marklogic.com/appservices/search";>
>>
>> <additional-query>{$or-query}</additional-query>
>>
>> </options>
>>
>>
>> let $search := search:search("Blah", $options)
>>
>>
>> return for $result in $search//search:result
>>
>> return $result/@uri || ": " || $result/@score
>>
>>
>> Any ideas about what is happening would be appreciated,
>>
>>
>> Thanks
>>
>>
>> Chris Rimmer
>>
>>
>> 67 Bricks
>>
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
>
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to