lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] Commented: (SOLR-1670) synonymfilter/map repeat bug
Date Sat, 19 Dec 2009 22:50:18 GMT


Robert Muir commented on SOLR-1670:

Koji, in my opinion the first step towards fixing this would be to resolve SOLR-1674.

This fixes the tests so that they reveal the true current behavior.
Because of the many problems with the current tests, I do not understand what the desired
behavior of this filter should even be.
The only thing I know for sure is what the current behavior is.

here is another example:
    // test that generated tokens start at the same offset as the original
    map.add(strings("a"), tokens("aa"), orig, merge);
    assertTokEqual(getTokList(map,"a,5",false), tokens("aa,5")); /* NOTE: This position increment
is really 1, but the test passes!!!! */

All the tests similar to the above test that position increments are the same as the original
But this is not actually what is happening, in fact synonymfilter is generating 'aa' with
a position increment of 1.

There are several examples like this in SOLR-1674. What I did was write the assertions so
that the tests pass, revealing the true behavior.
But I put comments above these assertions that say what i thought the existing test was trying
to show, i.e. the desired behavior.

> synonymfilter/map repeat bug
> ----------------------------
>                 Key: SOLR-1670
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 1.4
>            Reporter: Robert Muir
>         Attachments: SOLR-1670_test.patch
> as part of converting tests for SOLR-1657, I ran into a problem with synonymfilter
> the test for 'repeats' has a flaw, it uses this assertTokEqual construct which does not
really validate that two lists of token are equal, it just stops at the shorted one.
> {code}
>     // repeats
>     map.add(strings("a b"), tokens("ab"), orig, merge);
>     map.add(strings("a b"), tokens("ab"), orig, merge);
>     assertTokEqual(getTokList(map,"a b",false), tokens("ab"));
>     /* in reality the result from getTokList is ab ab ab!!!!! */
> {code}
> when converted to assertTokenStreamContents this problem surfaced. attached is an additional
assertion to the existing testcase.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message