Package org.lilyproject.indexer.model.indexerconf

Examples of org.lilyproject.indexer.model.indexerconf.IndexValue


        ValueType valueType = new StringValueType();
        FieldType fieldType = mock(FieldType.class);
        when(fieldType.getValueType()).thenReturn(valueType);

        HierarchicalFacetPrefixFormatter formatter = new HierarchicalFacetPrefixFormatter();
        IndexValue value = new IndexValue(null, fieldType, "foo/bar");
        List<String> result = formatter.format(Lists.newArrayList(value), null);

        assertEquals(2, result.size());
        assertEquals("0/foo", result.get(0));
        assertEquals("1/foo/bar", result.get(1));
View Full Code Here


        FieldType fieldType = mock(FieldType.class);
        when(fieldType.getValueType()).thenReturn(valueType);

        HierarchicalFacetPrefixFormatter formatter = new HierarchicalFacetPrefixFormatter();
        List<String> result = formatter.format(Lists.newArrayList(
                new IndexValue(null, fieldType, "foo/bar"),
                new IndexValue(null, fieldType, "bar/foo")), null);

        assertEquals(4, result.size());
        assertEquals("0/foo", result.get(0));
        assertEquals("1/foo/bar", result.get(1));
        assertEquals("0/bar", result.get(2));
View Full Code Here

        if (fieldType.getValueType().getBaseName().equals("LIST")) {
            List<Object> values = (List<Object>) value;
            indexValues = new ArrayList<IndexValue>(values.size());
            for (int i = 0; i < values.size(); i++) {
                indexValues.add(new IndexValue(record, fieldType, i, values.get(i)));
            }
        } else {
            indexValues = Collections.singletonList(new IndexValue(record, fieldType, value));
        }

        if (fieldType.getValueType().getDeepestValueType().getBaseName().equals("BLOB") && extractContent) {
            return extractContent(table, indexValues, repository);
        }
View Full Code Here

        if (fieldType.getValueType().getBaseName().equals("LIST")) {
            List<Object> values = (List<Object>) value;
            result = indexValues != null ? indexValues : new ArrayList<IndexValue>(values.size());
            for (int i = 0; i < values.size(); i++) {
                result.add(new IndexValue(record, fieldType, i, values.get(i)));
            }
            return result;
        } else {
            if (indexValues != null) {
                indexValues.add(new IndexValue(record, fieldType, value));
                result = indexValues;
            } else {
                result = Collections.singletonList(new IndexValue(record, fieldType, value));
            }
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.indexer.model.indexerconf.IndexValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.