Changeset 4862


Ignore:
Timestamp:
04/01/14 09:00:14 (10 years ago)
Author:
Twan Goosen
Message:

changed matching of value filtering from 'starts with' to 'contains'

Location:
vlo/branches/vlo-3.0/vlo-web-app/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java

    r4669 r4862  
    123123                @Override
    124124                public boolean apply(Count input) {
    125                     return input.getName().toLowerCase().startsWith(filterValue);
     125                    return input.getName().toLowerCase().contains(filterValue);
    126126                }
    127127            });
  • vlo/branches/vlo-3.0/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProviderTest.java

    r4855 r4862  
    147147    @Test
    148148    public void testFiltered() {
    149         final Model filterModel = Model.of("f");
     149        final Model filterModel = Model.of("th");
    150150        final FacetFieldValuesProvider instance = new FacetFieldValuesProvider(Model.of(facetField), 10, new SortParam<FieldValuesOrder>(FieldValuesOrder.NAME, true)) {
    151151
     
    161161        final Iterator<? extends FacetField.Count> result = instance.iterator(first, count);
    162162
    163         //sorted by name, filtered on first character 'f'
     163        //sorted by name, filtered on presence of 'th'
    164164        assertTrue(result.hasNext());
    165165        FacetField.Count valueCount = result.next();
    166         assertEquals("first value", valueCount.getName());
     166        assertEquals("fourth value", valueCount.getName());
    167167
    168168        assertTrue(result.hasNext());
    169169        valueCount = result.next();
    170         assertEquals("fourth value", valueCount.getName());
     170        assertEquals("third value", valueCount.getName());
    171171
    172172        assertFalse(result.hasNext());
Note: See TracChangeset for help on using the changeset viewer.