When createSearcher show No indices found, Where can I get it,Please help me
Closed this issue · 7 comments
// [private helpers]___________________________________________________
private static Searcher createSearcher(String indexPath) throws IOException {
ArrayList searchers = new ArrayList();
File indices = new File(indexPath);
File[] fileList = indices.listFiles();
if (fileList == null) {
throw new IOException(
String
.format(
"Unable to load indices from path '%s', not a directory or I/O error",
indexPath));
}
for (File file : fileList) {
try {
if (!LuceneMediator.indexExists(file)) {
continue;
}
FSDirectory directory = FSDirectory.open(file);
searchers.add(new IndexSearcher(directory));
} catch (IOException e) {
e.printStackTrace();
}
}
if (searchers.size() == 0) {
throw new IOException("No indices found");
}
return new MultiSearcher(searchers
.toArray(new Searchable[searchers.size()]));
}
Are you trying to run the GeneMANIA website (https://genemania.org/)?
I visit the https://genemania.org,It can search gene name, but when i deploy my computer, it not search gene name
Organism organism;
Long organismId;
try {
organismId = sReq.getOrganism();
organism = organismService.findOrganismById(organismId);
params.setOrganism(organism);
} catch (DataStoreException e) {
return new SearchResults(e.getMessage(), SearchResultsErrorCode.DATASTORE);
}
When I tried to perform a search gene name, I couldn't get organism ,by the way geneindexdir this data , where can I get it
- Download the r27.tar.gz file here: http://genemania.org/data/website/
- Unpack the r27.tar.gz file -- it should contain the lucene_index and network_cache folders inside r27.
- I suggest you run genemania as a Docker container so, on the Terminal, execute this command to get the latest image from Docker Hub:
docker pull baderlab/genemania_website
- Now run the docker container with a command like this:
sudo docker run -d -v /MY_PATH_TO/GENEMANIA_DATA:/gm/db_build \
-e GENEMANIA_LUCENE_INDEX_DIR='/gm/db_build/r27/lucene_index' \
-e GENEMANIA_NETWORK_CACHE_DIR='/gm/db_build/r27/network_cache' \
-p 8081:8080 \
--name genemania_website genemania_website
- Replace
/MY_PATH_TO/GENEMANIA_DATA
with the path that contains the r27 folder from step 2.
- Wait a few seconds and go to http://localhost:8081/ on your browser.
Please let me know if that works for you.
And if you want to build your own Docker image, you can use this Dockerfile (remove the ".txt" extension first):
Dockerfile.txt
To build the image, just run this command:
sudo docker build -t genemania_website .
You can also download the source files (.txt) for the genemania data here: http://genemania.org/data/website/r27-src.tar.gz
Thank you very much. I followed your steps to solve my problem. Genemania is great!