0

Hi everyone,

I went through the terrier quickstart tutorial corpus and then I run the code below:

import java.util.Arrays;
import org.terrier.indexing.Collection;
import org.terrier.indexing.SimpleFileCollection;
import org.terrier.structures.indexing.Indexer;
import org.terrier.structures.indexing.classical.BasicIndexer;
import org.terrier.utility.ApplicationSetup;

public class IndexingExample {

    public static void main(String[] args) throws Exception {
        // TODO Auto-generated method stub

        // Directory containing files to index
            String aDirectoryToIndex = "/home/nadhem/PFE/terrier-core-4.2/share/vaswani_npl/corpus/";

        // Configure Terrier
            ApplicationSetup.setProperty("terrier.home", "/home/nadhem/PFE/terrier-core-4.2"); 

            Indexer indexer = new BasicIndexer("/home/nadhem/PFE/terrier-core-4.2/var/index", "data");
            Collection coll = new SimpleFileCollection(Arrays.asList(aDirectoryToIndex), true);
            indexer.index(new Collection[]{coll});
    }

}

I got the following error:

WARNING: The file terrier.properties was not found at location /etc/terrier.properties Assuming the value of terrier.home from the corresponding system property. Please ensure that the property terrier.home is specified in the file terrier.properties, or as a system property in the command line.

I didn't understand why the properties file was not found despite having checked it...there is another

Any help would be most appreciated.

thanks, Nadhmanovic

1 Answers1

0

I solved the issue by supplying terrier.home as VM argument.

Click Run as then Run Configurations. You can change the parameters passed to the JVM in the Arguments tab in the VM Arguments box.

-Dterrier.home=/home/nadhem/PFE/terrier-core-4.2

I hope this will solve your issue.

Vino
  • 2,807
  • 1
  • 26
  • 22