diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
index 1ea89d8..36c8c86 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
@@ -1,27 +1,35 @@
 package de.ids_mannheim.korap.index;
 
-
+import org.junit.Test;
+import org.junit.Ignore;
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.spans.SpanTermQuery;
-import org.junit.Test;
-
 import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.constants.RelationDirection;
 import de.ids_mannheim.korap.query.SpanFocusQuery;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanRelationQuery;
+import de.ids_mannheim.korap.query.DistanceConstraint;
+import de.ids_mannheim.korap.query.SpanClassQuery;
+import de.ids_mannheim.korap.query.SpanElementQuery;
+import de.ids_mannheim.korap.query.SpanWithinQuery;
+import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
 import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.response.Result;
+import de.ids_mannheim.korap.util.QueryException;
+
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.spans.SpanTermQuery;
+import org.apache.lucene.search.spans.SpanQuery;
+import org.apache.lucene.search.spans.SpanOrQuery;
+
 
 public class TestFocusIndex {
     private KrillIndex ki;
     private Result kr;
 
-
     public TestFocusIndex () throws IOException {
         ki = new KrillIndex();
     }
@@ -55,4 +63,71 @@
         // System.out.println(m.getStartPos() + " " + m.getEndPos());
         // }
     }
+
+    @Test
+    @Ignore
+    public void testFocusSorting () throws IOException {
+        ki = new KrillIndex();
+        ki.addDoc(createFieldDoc());
+        ki.commit();
+
+        SpanElementQuery elemX = new SpanElementQuery("tokens", "x");
+
+        assertEquals("<tokens:x />", elemX.toString());
+
+        kr = ki.search(elemX, (short) 10);
+        assertEquals("[[abc]]d", kr.getMatch(0).getSnippetBrackets());
+        assertEquals("a[[bcd]]", kr.getMatch(1).getSnippetBrackets());
+        assertEquals(2, kr.getTotalResults());
+
+        SpanQuery termB = new SpanTermQuery(new Term("tokens", "s:b"));
+        SpanQuery termC = new SpanTermQuery(new Term("tokens", "s:c"));
+
+        SpanQuery classB = new SpanClassQuery(termB, (byte) 1);
+        SpanQuery classC = new SpanClassQuery(termC, (byte) 1);
+
+        SpanQuery within = new SpanWithinQuery(elemX, classB);
+
+        kr = ki.search(within, (short) 10);
+        assertEquals("[[a{1:b}c]]d", kr.getMatch(0).getSnippetBrackets());
+        assertEquals("a[[{1:b}cd]]", kr.getMatch(1).getSnippetBrackets());
+        assertEquals(2, kr.getTotalResults());
+
+        SpanQuery or = new SpanOrQuery(classB, classC);
+        within = new SpanWithinQuery(elemX, or);
+
+        kr = ki.search(within, (short) 10);
+        assertEquals("[[a{1:b}c]]d", kr.getMatch(0).getSnippetBrackets());
+        assertEquals("[[ab{1:c}]]d", kr.getMatch(1).getSnippetBrackets());
+        assertEquals("a[[{1:b}cd]]", kr.getMatch(2).getSnippetBrackets());
+        assertEquals("a[[b{1:c}d]]", kr.getMatch(3).getSnippetBrackets());
+        assertEquals(4, kr.getTotalResults());
+
+
+        SpanFocusQuery focus = new SpanFocusQuery(within, (byte) 1);
+        kr = ki.search(focus, (short) 10);
+        assertEquals("a[[{1:b}]]cd", kr.getMatch(0).getSnippetBrackets());
+        assertEquals("a[[{1:b}]]cd", kr.getMatch(1).getSnippetBrackets());
+        assertEquals("ab[[{1:c}]]d", kr.getMatch(2).getSnippetBrackets());
+        assertEquals("ab[[{1:c}]]d", kr.getMatch(3).getSnippetBrackets());
+        assertEquals(4, kr.getTotalResults());
+    }
+
+    public static FieldDocument createFieldDoc () {
+        FieldDocument fd = new FieldDocument();
+        fd.addString("ID", "doc-0");
+        fd.addTV(
+                "tokens",
+                "abcd",
+
+                "[(0-1)s:a|_0$<i>0<i>1|"
+                + "<>:x$<b>64<i>0<i>3<i>3<b>0]"
+                + "[(1-2)s:b|_1$<i>1<i>2|"
+                + "<>:x$<b>64<i>1<i>4<i>4<b>0]"
+                + "[(2-3)s:c|_2$<i>2<i>3]"
+                + "[(3-4)s:d|_3$<i>3<i>4]"
+                 );
+        
+        return fd;
+    }
 }
