// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/Result.java
// public class Result {
// 
//     private final String title;
//     private final String excerpt;
//     private final List<String> categories;
//     private final List<String> speakers;
//     private final Date date;
// 
//     public Result(String title, String excerpt, List<String> categories, List<String> speakers, Date date) {
//         this.title = title;
//         this.excerpt = excerpt;
//         this.categories = categories;
//         this.speakers = speakers;
//         this.date = date;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public String getExcerpt() {
//         return excerpt;
//     }
// 
//     public List<String> getCategories() {
//         return categories;
//     }
// 
//     public List<String> getSpeakers() {
//         return speakers;
//     }
// 
//     public Date getDate() {
//         return date;
//     }
// }
// 
// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/Talk.java
// public class Talk {
// 
//     public final String path;
//     public final String title;
//     public final List<String> speakers;
//     public final Date date;
//     public final String content;
//     public final List<String> categories;
//     public final String organizer;
// 
//     public Talk(String path, String title, List<String> speakers, Date date, String content, List<String> categories, String organizer) {
//         this.path = path;
//         this.title = title;
//         this.speakers = speakers;
//         this.date = date;
//         this.content = content;
//         this.categories = categories;
//         this.organizer = organizer;
//     }
// }


import com.google.common.base.Optional;
import de.fhopf.lucenesolrtalk.Result;
import de.fhopf.lucenesolrtalk.Talk;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.junit.Before;
import org.junit.Test;
import java.util.*;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import org.apache.lucene.queryparser.classic.ParseException;
package de.fhopf.lucenesolrtalk.lucene;




public class SearcherTest {

    private Indexer indexer;
    private Searcher searcher;

    @Before
    public void initIndexerAndSearcher() {
        Directory dir = new RAMDirectory();
        indexer = new Indexer(dir);
        searcher = new Searcher(dir);
    }

    @Test
    public void searchAuthor() throws ParseException {
        Talk talk1 = newAuthorTalk("Florian Hopf");
        Talk talk2 = newAuthorTalk("Florian");
        indexer.index(talk1, talk2);
// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/Result.java
// public class Result {
// 
//     private final String title;
//     private final String excerpt;
//     private final List<String> categories;
//     private final List<String> speakers;
//     private final Date date;
// 
//     public Result(String title, String excerpt, List<String> categories, List<String> speakers, Date date) {
//         this.title = title;
//         this.excerpt = excerpt;
//         this.categories = categories;
//         this.speakers = speakers;
//         this.date = date;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public String getExcerpt() {
//         return excerpt;
//     }
// 
//     public List<String> getCategories() {
//         return categories;
//     }
// 
//     public List<String> getSpeakers() {
//         return speakers;
//     }
// 
//     public Date getDate() {
//         return date;
//     }
// }
// 
// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/Talk.java
// public class Talk {
// 
//     public final String path;
//     public final String title;
//     public final List<String> speakers;
//     public final Date date;
//     public final String content;
//     public final List<String> categories;
//     public final String organizer;
// 
//     public Talk(String path, String title, List<String> speakers, Date date, String content, List<String> categories, String organizer) {
//         this.path = path;
//         this.title = title;
//         this.speakers = speakers;
//         this.date = date;
//         this.content = content;
//         this.categories = categories;
//         this.organizer = organizer;
//     }
// }


// Path: lucene/src/test/java/de/fhopf/lucenesolrtalk/lucene/SearcherTest.java
import com.google.common.base.Optional;
import de.fhopf.lucenesolrtalk.Result;
import de.fhopf.lucenesolrtalk.Talk;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.junit.Before;
import org.junit.Test;
import java.util.*;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import org.apache.lucene.queryparser.classic.ParseException;

package de.fhopf.lucenesolrtalk.lucene;




public class SearcherTest {

    private Indexer indexer;
    private Searcher searcher;

    @Before
    public void initIndexerAndSearcher() {
        Directory dir = new RAMDirectory();
        indexer = new Indexer(dir);
        searcher = new Searcher(dir);
    }

    @Test
    public void searchAuthor() throws ParseException {
        Talk talk1 = newAuthorTalk("Florian Hopf");
        Talk talk2 = newAuthorTalk("Florian");
        indexer.index(talk1, talk2);
        List<Result> documents = searcher.search("speaker:Florian");