[Xapian-tickets] [Xapian] #590: MSetIterator::get_percent Shows Increased Values When Using Query::OP_FILTER

Xapian nobody at xapian.org
Mon Mar 19 05:48:34 GMT 2012


#590: MSetIterator::get_percent Shows Increased Values When Using
Query::OP_FILTER
---------------------+------------------------------------------------------
 Reporter:  mhenson  |       Owner:  olly    
     Type:  defect   |      Status:  assigned
 Priority:  normal   |   Milestone:  1.2.10  
Component:  Matcher  |     Version:          
 Severity:  normal   |    Keywords:          
Blockedby:           |    Platform:  All     
 Blocking:           |  
---------------------+------------------------------------------------------
Changes (by olly):

  * milestone:  1.3.1 => 1.2.10


Old description:

> I'm seeing some rather odd behavior with respect to the match percent
> that is returned when performing a simple query. It appears that the
> addition of a filter to a simple OR query will not affect the weight of
> the match, but will increase the percent of the resulting match.
> According to the documentation for MSetIterator::get_percent
> (http://xapian.org/docs/apidoc/html/classXapian_1_1MSetIterator.html#99514c11a9291175d20fafa73a0839fd)
> a match should only get 100% if it matches all of the weight contributing
> terms in the query.
>
> I've attached a test case that shows the odd behavior that I am seeing. I
> had a database with 2 documents, each with one term 'cold' and 'kid'.
> Each document also has a boolean term for the owner of the document
> 'Ome'.
>
> Below are the results for a search for 'cold kids' on that set with and
> without the owner filter. The weight 0.405465108108 stays the same for
> both queries, but the percentage increases from 50 to 100 with the
> addition of the filter.
>
> Query: Xapian::Query((cold OR kids))
> 1 - 0.405465108108 - 50 - Ome, cold
> 2 - 0.405465108108 - 50 - Ome, kids
>
> Query: Xapian::Query(((cold OR kids) FILTER Ome))
> 1 - 0.405465108108 - 100 - Ome, cold
> 2 - 0.405465108108 - 100 - Ome, kids

New description:

 I'm seeing some rather odd behavior with respect to the match percent that
 is returned when performing a simple query. It appears that the addition
 of a filter to a simple OR query will not affect the weight of the match,
 but will increase the percent of the resulting match. According to the
 documentation for MSetIterator::get_percent
 (http://xapian.org/docs/apidoc/html/classXapian_1_1MSetIterator.html#99514c11a9291175d20fafa73a0839fd)
 a match should only get 100% if it matches all of the weight contributing
 terms in the query.

 I've attached a test case that shows the odd behavior that I am seeing. I
 had a database with 2 documents, each with one term 'cold' and 'kid'. Each
 document also has a boolean term for the owner of the document 'Ome'.

 Below are the results for a search for 'cold kids' on that set with and
 without the owner filter. The weight 0.405465108108 stays the same for
 both queries, but the percentage increases from 50 to 100 with the
 addition of the filter.

 {{{
 Query: Xapian::Query((cold OR kids))
 1 - 0.405465108108 - 50 - Ome, cold
 2 - 0.405465108108 - 50 - Ome, kids

 Query: Xapian::Query(((cold OR kids) FILTER Ome))
 1 - 0.405465108108 - 100 - Ome, cold
 2 - 0.405465108108 - 100 - Ome, kids
 }}}

--

Comment:

 Fixed in trunk by r16429.  The testcase I added fails with 1.2, so I guess
 this fix needs backporting.

-- 
Ticket URL: <http://trac.xapian.org/ticket/590#comment:2>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list