Search in sources :

Example 21 with CollectionBuilder

use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.

the class TestCollectionBuilder method builderDateMonth.

@Test
public void builderDateMonth() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    assertEquals("pubDate:[20051000 TO 20051099]", kc.date("pubDate", "2005-10").toString());
}
Also used : CollectionBuilder(de.ids_mannheim.korap.collection.CollectionBuilder) Test(org.junit.Test)

Example 22 with CollectionBuilder

use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.

the class TestCollectionBuilder method builderTill.

@Test
public void builderTill() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    assertEquals("pubDate:[0 TO 20059999]", kc.till("pubDate", "2005").toString());
    assertEquals("pubDate:[0 TO 20051299]", kc.till("pubDate", "2005-12").toString());
    assertEquals("pubDate:[0 TO 20051204]", kc.till("pubDate", "2005-12-04").toString());
}
Also used : CollectionBuilder(de.ids_mannheim.korap.collection.CollectionBuilder) Test(org.junit.Test)

Example 23 with CollectionBuilder

use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.

the class TestCollectionBuilder method builderNegation.

@Test
public void builderNegation() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    CollectionBuilder.Interface kbi = kc.term("author", "tree").not();
    assertEquals("author:tree", kbi.toString());
    assertTrue(kbi.isNegative());
    kbi = kc.andGroup().with(kc.term("author", "tree").not());
    assertEquals("author:tree", kbi.toString());
    assertTrue(kbi.isNegative());
    kbi = kc.orGroup().with(kc.term("author", "tree").not());
    assertEquals("author:tree", kbi.toString());
    assertTrue(kbi.isNegative());
}
Also used : CollectionBuilder(de.ids_mannheim.korap.collection.CollectionBuilder) Test(org.junit.Test)

Example 24 with CollectionBuilder

use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.

the class TestCollectionBuilder method builderRegex.

@Test
public void builderRegex() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    assertEquals("QueryWrapperFilter(author:/tre*?/)", kc.re("author", "tre*?").toString());
}
Also used : CollectionBuilder(de.ids_mannheim.korap.collection.CollectionBuilder) Test(org.junit.Test)

Example 25 with CollectionBuilder

use of de.ids_mannheim.korap.collection.CollectionBuilder in project Krill by KorAP.

the class TestCollectionBuilder method builderOrSimple.

@Test
public void builderOrSimple() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    assertEquals("author:tree", kc.orGroup().with(kc.term("author", "tree")).toString());
}
Also used : CollectionBuilder(de.ids_mannheim.korap.collection.CollectionBuilder) Test(org.junit.Test)

Aggregations

CollectionBuilder (de.ids_mannheim.korap.collection.CollectionBuilder)33 Test (org.junit.Test)33 KrillCollection (de.ids_mannheim.korap.KrillCollection)11 KrillIndex (de.ids_mannheim.korap.KrillIndex)11 Krill (de.ids_mannheim.korap.Krill)5 Result (de.ids_mannheim.korap.response.Result)4 QueryBuilder (de.ids_mannheim.korap.query.QueryBuilder)3 TestSimple.getJsonString (de.ids_mannheim.korap.TestSimple.getJsonString)2 FieldDocument (de.ids_mannheim.korap.index.FieldDocument)2 SearchContext (de.ids_mannheim.korap.response.SearchContext)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 KrillMeta (de.ids_mannheim.korap.KrillMeta)1 SpanDistanceQuery (de.ids_mannheim.korap.query.SpanDistanceQuery)1