Search in sources :

Example 11 with ListFilter

use of io.vertigo.dynamo.collections.ListFilter in project vertigo by KleeGroup.

the class SearchManagerStoreTest method doRemove.

private void doRemove(final String query) {
    final ListFilter removeQuery = ListFilter.of(query);
    searchManager.removeAll(carIndexDefinition, removeQuery);
}
Also used : ListFilter(io.vertigo.dynamo.collections.ListFilter)

Example 12 with ListFilter

use of io.vertigo.dynamo.collections.ListFilter in project vertigo by KleeGroup.

the class AbstractSearchManagerTest method doRemove.

private void doRemove(final String query) {
    final ListFilter removeQuery = ListFilter.of(query);
    searchManager.removeAll(itemIndexDefinition, removeQuery);
}
Also used : ListFilter(io.vertigo.dynamo.collections.ListFilter)

Example 13 with ListFilter

use of io.vertigo.dynamo.collections.ListFilter in project vertigo by KleeGroup.

the class SearchManagerMultiIndexTest method testClean.

/**
 * Test de création nettoyage de l'index.
 * La création s'effectue dans une seule transaction.
 */
@Test
public void testClean() {
    final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
    final SearchIndexDefinition itemIndexDefinition = definitionSpace.resolve(IDX_ITEM, SearchIndexDefinition.class);
    final SearchIndexDefinition itemDynIndexDefinition = definitionSpace.resolve(IDX_DYNA_ITEM, SearchIndexDefinition.class);
    final ListFilter removeQuery = ListFilter.of("*:*");
    searchManager.removeAll(itemIndexDefinition, removeQuery);
    searchManager.removeAll(itemDynIndexDefinition, removeQuery);
    waitIndexation();
    final long size = query("*:*", itemIndexDefinition);
    Assert.assertEquals(0, size);
    final long sizeDyn = query("*:*", itemDynIndexDefinition);
    Assert.assertEquals(0, sizeDyn);
}
Also used : ListFilter(io.vertigo.dynamo.collections.ListFilter) SearchIndexDefinition(io.vertigo.dynamo.search.metamodel.SearchIndexDefinition) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) Test(org.junit.Test)

Example 14 with ListFilter

use of io.vertigo.dynamo.collections.ListFilter in project vertigo by KleeGroup.

the class SearchDynamicRegistry method createFacetValue.

private static FacetValue createFacetValue(final DslDefinition rangeDefinition) {
    final String listFilterString = (String) rangeDefinition.getPropertyValue(SearchGrammar.RANGE_FILTER_PROPERTY);
    final ListFilter listFilter = ListFilter.of(listFilterString);
    final String label = (String) rangeDefinition.getPropertyValue(KspProperty.LABEL);
    final MessageText labelMsg = MessageText.of(label);
    final String code = rangeDefinition.getName();
    return new FacetValue(code, listFilter, labelMsg);
}
Also used : ListFilter(io.vertigo.dynamo.collections.ListFilter) FacetValue(io.vertigo.dynamo.collections.model.FacetValue) MessageText(io.vertigo.core.locale.MessageText)

Example 15 with ListFilter

use of io.vertigo.dynamo.collections.ListFilter in project vertigo by KleeGroup.

the class IndexDtListFunctionBuilderImpl method filterByValue.

/**
 * {@inheritDoc}
 */
@Override
public IndexDtListFunctionBuilder<D> filterByValue(final String fieldName, final String value) {
    Assertion.checkNotNull(value);
    // -----
    final String escapedValue = value.replace("\"", "\\\"");
    final ListFilter listFilter = ListFilter.of(fieldName + ":\"" + escapedValue + "\"");
    indexFilterFunction.filter(listFilter);
    return this;
}
Also used : ListFilter(io.vertigo.dynamo.collections.ListFilter)

Aggregations

ListFilter (io.vertigo.dynamo.collections.ListFilter)16 FacetValue (io.vertigo.dynamo.collections.model.FacetValue)3 DefinitionSpace (io.vertigo.core.definition.DefinitionSpace)2 MessageText (io.vertigo.core.locale.MessageText)2 SearchIndexDefinition (io.vertigo.dynamo.search.metamodel.SearchIndexDefinition)2 HashMap (java.util.HashMap)2 QueryNodeException (org.apache.lucene.queryparser.flexible.core.QueryNodeException)2 StandardQueryParser (org.apache.lucene.queryparser.flexible.standard.StandardQueryParser)2 BooleanQuery (org.apache.lucene.search.BooleanQuery)2 Builder (org.apache.lucene.search.BooleanQuery.Builder)2 Test (org.junit.Test)2 FacetDefinition (io.vertigo.dynamo.collections.metamodel.FacetDefinition)1 DtField (io.vertigo.dynamo.domain.metamodel.DtField)1 DtList (io.vertigo.dynamo.domain.model.DtList)1 DtObject (io.vertigo.dynamo.domain.model.DtObject)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1