public static IndexRef of(String location){ return new IndexRef(location); }
@Override public int hashCode() { return toString().hashCode(); }
/** * Loads index(s) from disk. * */ @SuppressWarnings("deprecation") protected void loadIndex() { indexref = IndexRef.of(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX); }
@Override public boolean supports(IndexRef ref) { return ref.toString().startsWith("http"); }
/** * Loads index(s) from disk. * */ @SuppressWarnings("deprecation") protected void loadIndex() { indexref = IndexRef.of(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX); }
@Override public boolean supports(IndexRef ref) { return ref.toString().startsWith("http"); }
@Override public boolean supports(IndexRef ref) { String l = ref.toString(); if (ref.size() > 1) return false; //this is a multi-index if (l.startsWith("http") || l.startsWith("https") || l.startsWith("concurrent")) return false; if (! l.endsWith(".properties")) return false; return Files.exists(l); }
@VisibleForTesting @SuppressWarnings("deprecation") public static void reinit() { indexRef = IndexRef.of(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX); m = ManagerFactory.from(indexRef); }
public static IndexRef makeConcurrent(IndexRef ref) { if (IndexFactory.isLoaded(ref)) return new DirectIndexRef( ConcurrentIndexUtils.makeConcurrentForRetrieval( ((DirectIndexRef)ref).underlyingIndex )){ private static final long serialVersionUID = 1L; @Override public String toString() { return PREFIX + super.toString(); } }; return IndexRef.of(PREFIX + ref.toString()); }
@Override public boolean supports(IndexRef ref) { return ref.toString().contains("#INCREMENTAL"); }
@Override public boolean supports(IndexRef ref) { String l = ref.toString(); if (ref.size() > 1) return false; //this is a multi-index if (l.startsWith("http") || l.startsWith("https") || l.startsWith("concurrent")) return false; if (! l.endsWith(".properties")) return false; return Files.exists(l); }
/** * Create a querying manager. This method should be overriden if * another matching model is required. */ @SuppressWarnings("deprecation") protected void createManager() { queryingManager = ManagerFactory.from(IndexRef.of(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX)); }
public static IndexRef makeConcurrent(IndexRef ref) { if (IndexFactory.isLoaded(ref)) return new DirectIndexRef( ConcurrentIndexUtils.makeConcurrentForRetrieval( ((DirectIndexRef)ref).underlyingIndex )){ private static final long serialVersionUID = 1L; @Override public String toString() { return PREFIX + super.toString(); } }; return IndexRef.of(PREFIX + ref.toString()); }
public static boolean isConcurrent(IndexRef ref) { return ref.toString().startsWith(PREFIX); }
/** * Create a querying manager. This method should be overriden if * another matching model is required. */ @SuppressWarnings("deprecation") protected void createManager() { queryingManager = ManagerFactory.from(IndexRef.of(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX)); }
@Override public int run(CommandLine line) throws Exception { @SuppressWarnings("deprecation") IndexRef ref = IndexRef.of(ApplicationSetup.TERRIER_INDEX_PATH, ApplicationSetup.TERRIER_INDEX_PREFIX); Index index = IndexFactory.of(ref); if (index == null) System.err.println("No such index: " + ref.toString()); return 1;