Search in sources :

Example 1 with CollectionBuilder

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

the class TestCollectionBuilder method builderGroups.

@Test
public void builderGroups() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    String g = kc.orGroup().with(kc.orGroup().with(kc.term("author", "tree1")).with(kc.term("title", "name1"))).with(kc.andGroup().with(kc.term("author", "tree2")).with(kc.term("title", "name2"))).toString();
    assertEquals("OrGroup(OrGroup(author:tree1 title:name1) AndGroup(author:tree2 title:name2))", g);
}
Also used : CollectionBuilder(de.ids_mannheim.korap.collection.CollectionBuilder) Test(org.junit.Test)

Example 2 with CollectionBuilder

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

the class TestCollectionBuilder method builderOrNestedSimple.

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

Example 3 with CollectionBuilder

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

the class TestCollectionBuilder method builderDateYear.

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

Example 4 with CollectionBuilder

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

the class TestCollectionBuilder method builderOrCombined.

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

Example 5 with CollectionBuilder

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

the class TestCollectionBuilder method builderTerm.

@Test
public void builderTerm() throws IOException {
    CollectionBuilder kc = new CollectionBuilder();
    assertEquals("author:tree", 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