Codota Logo
DiscoverQuery.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.dspace.discovery.DiscoverQuery
constructor

Best Java code snippets using org.dspace.discovery.DiscoverQuery.<init> (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: DSpace/DSpace

DiscoverQuery discoverQuery = new DiscoverQuery();
if (StringUtils.isNotBlank(type)) {
  discoverQuery.addFilterQueries("dc.type=" + type + "*");
origin: DSpace/DSpace

private void calculateNewRangeBasedOnSearchIndex(Context context, List<String> filterQueries, DSpaceObject scope,
                         SearchService searchService) throws SearchServiceException {
  DiscoverQuery yearRangeQuery = new DiscoverQuery();
  yearRangeQuery.setMaxResults(1);
  //Set our query to anything that has this value
  yearRangeQuery.addFieldPresentQueries(dateFacet);
  //Set sorting so our last value will appear on top
  yearRangeQuery.setSortField(dateFacet + "_sort", DiscoverQuery.SORT_ORDER.asc);
  yearRangeQuery.addFilterQueries(filterQueries.toArray(new String[filterQueries.size()]));
  yearRangeQuery.addSearchField(dateFacet);
  DiscoverResult lastYearResult = searchService.search(context, scope, yearRangeQuery);
  if (0 < lastYearResult.getDspaceObjects().size()) {
    List<DiscoverResult.SearchDocument> searchDocuments = lastYearResult
      .getSearchDocument(lastYearResult.getDspaceObjects().get(0));
    if (0 < searchDocuments.size() && 0 < searchDocuments.get(0).getSearchFieldValues(dateFacet).size()) {
      oldestYear = Integer.parseInt(searchDocuments.get(0).getSearchFieldValues(dateFacet).get(0));
    }
  }
  //Now get the first year
  yearRangeQuery.setSortField(dateFacet + "_sort", DiscoverQuery.SORT_ORDER.desc);
  DiscoverResult firstYearResult = searchService.search(context, scope, yearRangeQuery);
  if (0 < firstYearResult.getDspaceObjects().size()) {
    List<DiscoverResult.SearchDocument> searchDocuments = firstYearResult
      .getSearchDocument(firstYearResult.getDspaceObjects().get(0));
    if (0 < searchDocuments.size() && 0 < searchDocuments.get(0).getSearchFieldValues(dateFacet).size()) {
      newestYear = Integer.parseInt(searchDocuments.get(0).getSearchFieldValues(dateFacet).get(0));
    }
  }
}
origin: DSpace/DSpace

  @Override
  public String calculateExtremeValue(Context context, String valueField,
                    String sortField,
                    DiscoverQuery.SORT_ORDER sortOrder)
    throws SearchServiceException {

    DiscoverQuery maxQuery = new DiscoverQuery();
    maxQuery.setMaxResults(1);
    //Set our query to anything that has this value
    maxQuery.addFieldPresentQueries(valueField);
    //Set sorting so our last value will appear on top
    maxQuery.setSortField(sortField, sortOrder);
    maxQuery.addSearchField(valueField);
    DiscoverResult maxResult = this.search(context,maxQuery);
    if (0 < maxResult.getDspaceObjects().size()) {
      List<DiscoverResult.SearchDocument> searchDocuments = maxResult
        .getSearchDocument(maxResult.getDspaceObjects().get(0));
      if (0 < searchDocuments.size() && 0 < searchDocuments.get(0).getSearchFieldValues
        (valueField).size()) {
        return searchDocuments.get(0).getSearchFieldValues(valueField).get(0);
      }
    }
    return null;
  }
}
origin: DSpace/DSpace

@Override
public String doMaxQuery(String column, String table, int itemID)
  throws BrowseException {
  DiscoverQuery query = new DiscoverQuery();
  query.setQuery("search.resourceid:" + itemID
            + " AND search.resourcetype:" + Constants.ITEM);
  query.setMaxResults(1);
  DiscoverResult resp = null;
  try {
    resp = searcher.search(context, query);
  } catch (SearchServiceException e) {
    throw new BrowseException(e);
  }
  if (resp.getTotalSearchResults() > 0) {
    SearchDocument doc = resp.getSearchDocument(
      resp.getDspaceObjects().get(0)).get(0);
    return (String) doc.getSearchFieldValues(column).get(0);
  }
  return null;
}
origin: org.dspace/dspace-discovery-xmlui-api

    /**
   * Retrieves the lowest date value in the given field
   * @param query a solr query
   * @param dateField the field for which we want to retrieve our date
   * @param filterquery the filterqueries
   * @return the lowest date found, in a date object
   */
  private Date getLowestDateValue(Context context, String query, String dateField, String... filterquery){


    try {
      DiscoverQuery discoverQuery = new DiscoverQuery();
      discoverQuery.setQuery(query);
      discoverQuery.setMaxResults(1);
      discoverQuery.setSortField(dateField, DiscoverQuery.SORT_ORDER.asc);
      discoverQuery.addFilterQueries(filterquery);

      DiscoverResult rsp = searchService.search(context, discoverQuery);
//            if(0 < rsp.getResults().getNumFound()){
//                return (Date) rsp.getResults().get(0).getFieldValue(dateField);
//            }
    }catch (Exception e){
      log.error("Unable to get lowest date", e);
    }
    return null;
  }

origin: org.dspace/dspace-discovery-xmlui-api

public DiscoverQuery getQueryArgs(Context context, DSpaceObject scope, String... filterQueries) {
  DiscoverQuery queryArgs = new DiscoverQuery();
            DiscoverQuery yearRangeQuery = new DiscoverQuery();
            yearRangeQuery.setMaxResults(1);
origin: DSpace/DSpace

collectionsCount = new HashMap<String, Integer>();
DiscoverQuery query = new DiscoverQuery();
query.setFacetMinCount(1);
query.addFacetField(new DiscoverFacetField("location.comm",
origin: org.dspace/dspace-discovery-xmlui-api

DiscoverQuery queryArgs = new DiscoverQuery();
origin: org.dspace/dspace-discovery-xmlui-api

queryArgs = new DiscoverQuery();
origin: org.dspace/dspace-discovery-xmlui-api

queryArgs = new DiscoverQuery();
origin: org.dspace/dspace-discovery-xmlui-api

this.response = ObjectModelHelper.getResponse(objectModel);
DiscoverQuery queryArgs = new DiscoverQuery();
origin: org.dspace/dspace-discovery-xmlui-api

this.queryArgs = new DiscoverQuery();
origin: DSpace/DSpace

                     boolean items, boolean collections, boolean withdrawn,
                     boolean nonAnon) throws SQLException, ParseException {
DiscoverQuery discoverQuery = new DiscoverQuery();
discoverQuery.addFilterQueries("search.resourcetype:" + Constants.ITEM);
origin: DSpace/DSpace

private DiscoverResult getSolrResponse() throws BrowseException {
  if (sResponse == null) {
    DiscoverQuery query = new DiscoverQuery();
    addLocationScopeFilter(query);
    addStatusFilter(query);
origin: DSpace/DSpace

@Override
public int doOffsetQuery(String column, String value, boolean isAscending)
  throws BrowseException {
  DiscoverQuery query = new DiscoverQuery();
  addLocationScopeFilter(query);
  addStatusFilter(query);
org.dspace.discoveryDiscoverQuery<init>

Popular methods of DiscoverQuery

  • addFilterQueries
    Adds new filter queries
  • getFacetOffset
    Gets the facet field offset
  • getMaxResults
    The maximum number of results returned by this query
  • getQuery
  • addFacetField
    Adds a new facet field
  • addFacetQuery
    Adds a new facet query
  • addFieldPresentQueries
    Adds a query that will ensure that a certain field is present in the index
  • addSearchField
  • getDSpaceObjectFilter
    Gets the DSpace object filter can be used to only return objects from a certain DSpace Object type
  • getFacetFields
    Gets the facets fields configured
  • getFacetMinCount
    Gets the minimum number of values that need to be present before a valid facet value has been found
  • getFacetQueries
    Returns the facet queries
  • getFacetMinCount,
  • getFacetQueries,
  • getFieldPresentQueries,
  • getFilterQueries,
  • getProperties,
  • getSearchFields,
  • getSortField,
  • getSortOrder,
  • getStart

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
  • setContentView (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now