/** * create full index - wiping old index * * @param c context to use */ @Override public void createIndex(Context c) throws SQLException, IOException { /* Reindex all content preemptively. */ updateIndex(c, true); }
@Override public FacetYearRange getFacetYearRange(Context context, DSpaceObject scope, DiscoverySearchFilterFacet facet, List<String> filterQueries) throws SearchServiceException { FacetYearRange result = new FacetYearRange(facet); result.calculateRange(context, filterQueries, scope, this); return result; }
@Override public DiscoverResult search(Context context, DiscoverQuery query) throws SearchServiceException { return search(context, query, false); }
public DiscoverFilterQuery toFilterQuery(Context context, String field, String value) throws SQLException{ DiscoverFilterQuery result = new DiscoverFilterQuery(); result.setField(field); result.setDisplayedValue(transformDisplayedValue(context, field, value)); // TODO: solr escape of value ? result.setFilterQuery((field == null || field.equals("") ? "" : field + ":") + "(" + value + ")"); return result; }
@Override public DiscoverResult search(Context context, DiscoverQuery discoveryQuery, boolean includeUnDiscoverable) throws SearchServiceException { try { if (getSolr() == null) { return new DiscoverResult(); } SolrQuery solrQuery = resolveToSolrQuery(context, discoveryQuery, includeUnDiscoverable); QueryResponse queryResponse = getSolr().query(solrQuery, SolrRequest.METHOD.POST); return retrieveResult(context, discoveryQuery, queryResponse); } catch (Exception e) { throw new org.dspace.discovery.SearchServiceException(e.getMessage(), e); } }
public DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery discoveryQuery) throws SearchServiceException { if(dso != null){ if (dso instanceof Community) { discoveryQuery.addFilterQueries("location:m" + dso.getID()); } else if (dso instanceof Collection) { discoveryQuery.addFilterQueries("location:l" + dso.getID()); } else if (dso instanceof Item){ discoveryQuery.addFilterQueries("handle:" + dso.getHandle()); } } return search(context, discoveryQuery); }
@Override public void indexContent(Context context, DSpaceObject dso, boolean force, boolean commit) throws SearchServiceException, SQLException { indexContent(context, dso, force); if (commit) { commit(); } }
public static DiscoveryConfiguration getDiscoveryConfiguration() { return getDiscoveryConfiguration(null); }
/** * Unindex a Document in the Lucene index. * * @param context the dspace context * @param handle the handle of the object to be deleted * @throws IOException if IO error * @throws SQLException if database error */ @Override public void unIndexContent(Context context, String handle) throws IOException, SQLException { unIndexContent(context, handle, false); }
/** * If the handle for the "dso" already exists in the index, and the "dso" * has a lastModified timestamp that is newer than the document in the index * then it is updated, otherwise a new document is added. * * @param context Users Context * @param dso DSpace Object (Item, Collection or Community * @throws SQLException if error */ @Override public void indexContent(Context context, DSpaceObject dso) throws SQLException { indexContent(context, dso, false); }
public FullTextContentStreams(Context context, Item parentItem) throws SQLException { this.context = context; init(parentItem); }
@Override public DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery discoveryQuery, boolean includeUnDiscoverable) throws SearchServiceException { if (dso != null) { if (dso instanceof Community) { discoveryQuery.addFilterQueries("location:m" + dso.getID()); } else if (dso instanceof Collection) { discoveryQuery.addFilterQueries("location:l" + dso.getID()); } else if (dso instanceof Item) { discoveryQuery.addFilterQueries(HANDLE_FIELD + ":" + dso.getHandle()); } } return search(context, discoveryQuery, includeUnDiscoverable); }
/** * Iterates over all Items, Collections and Communities. And updates them in * the index. Uses decaching to control memory footprint. Uses indexContent * and isStale to check state of item in index. * * @param context the dspace context */ @Override public void updateIndex(Context context) { updateIndex(context, false); }
@Override public DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery query) throws SearchServiceException { return search(context, dso, query, false); }
/** * Unindex a Document in the Lucene index. * @param context the dspace context * @param handle the handle of the object to be deleted * @throws IOException * @throws SQLException */ public void unIndexContent(Context context, String handle) throws IOException, SQLException { unIndexContent(context, handle, false); }
/** * Iterates over all Items, Collections and Communities. And updates them in * the index. Uses decaching to control memory footprint. Uses indexContent * and isStale to check state of item in index. * * @param context the dspace context */ public void updateIndex(Context context) { updateIndex(context, false); }
public List<DSpaceObject> search(Context context, String query, int offset, int max, String... filterquery) { return search(context, query, null, true, offset, max, filterquery); }
/** * unIndex removes an Item, Collection, or Community * * @param context The relevant DSpace Context. * @param dso DSpace Object, can be Community, Item, or Collection * @throws SQLException if database error * @throws IOException if IO error */ @Override public void unIndexContent(Context context, DSpaceObject dso) throws SQLException, IOException { unIndexContent(context, dso, false); }
/** * create full index - wiping old index * * @param c context to use */ public void createIndex(Context c) throws SQLException, IOException { /* Reindex all content preemptively. */ updateIndex(c, true); }
public List<DSpaceObject> search(Context context, String query, int offset, int max, String... filterquery) { return search(context, query, null, true, offset, max, filterquery); }