Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-1564

Add test search against index to LuceneCASIndexerTest.testIndexOneDocument test

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Abandoned
    • 2.3S
    • None
    • Sandbox-Lucas

    Description

      The test should index one document and then do a test search against the freshly created index. After modifying the lucas.xml in a way its indexing the DocumentAnnotation I was unable to do a test search with the following code:

      FSDirectory directory = (FSDirectory) luceneCASIndexer.getIndexWriter().getDirectory();

      String path = directory.getFile().getPath();

      // Make sure index gets written to disk ...
      analysisEngine.destroy();

      // Open index and do a test search against it.
      IndexSearcher searcher = new IndexSearcher(path);

      QueryParser parser = new QueryParser("text", new SimpleAnalyzer());
      Query query = parser.parse("test document");

      searcher.search(query, new HitCollector() {

      @Override
      public void collect(int doc, float score)

      { ... }

      });

      Can you please have a look Rico ?

      In the end it would be nice if all three kinds of text sources are tested, covered text, feature values, referenced feature values.

      Attachments

        Activity

          People

            rico.la Rico Landefeld
            joern Jörn Kottmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: