org.dspace.discovery
Class DiscoverQuery

java.lang.Object
  extended by org.dspace.discovery.DiscoverQuery

public class DiscoverQuery
extends Object

This class represents a query which the discovery backend can use

Author:
Kevin Van de Velde (kevin at atmire dot com)

Nested Class Summary
static class DiscoverQuery.SORT_ORDER
          Attributes used for sorting of results
 
Constructor Summary
DiscoverQuery()
           
 
Method Summary
 void addFacetField(DiscoverFacetField facetField)
          Adds a new facet field
 void addFacetQuery(String facetQuery)
          Adds a new facet query
 void addFieldPresentQueries(String... fieldPresentQueries)
          Adds a query that will ensure that a certain field is present in the index
 void addFilterQueries(String... filterQueries)
          Adds new filter queries
 void addHitHighlightingField(DiscoverHitHighlightingField hitHighlighting)
           
 void addProperty(String property, String value)
          Adds a new search property to the misc search properties
 void addSearchField(String field)
           
 int getDSpaceObjectFilter()
          Gets the DSpace object filter can be used to only return objects from a certain DSpace Object type
 List<DiscoverFacetField> getFacetFields()
          Gets the facets fields configured
 int getFacetMinCount()
          Gets the minimum number of values that need to be present before a valid facet value has been found
 int getFacetOffset()
          Gets the facet field offset
 List<String> getFacetQueries()
          Returns the facet queries
 List<String> getFieldPresentQueries()
           
 List<String> getFilterQueries()
          Returns the filter queries
 DiscoverHitHighlightingField getHitHighlightingField(String field)
           
 List<DiscoverHitHighlightingField> getHitHighlightingFields()
           
 int getMaxResults()
          The maximum number of results returned by this query
 Map<String,List<String>> getProperties()
          Returns the misc search properties
 String getQuery()
           
 List<String> getSearchFields()
           
 String getSortField()
           
 DiscoverQuery.SORT_ORDER getSortOrder()
           
 int getStart()
           
 void setDSpaceObjectFilter(int DSpaceObjectFilter)
          Sets the DSpace object filter, must be an DSpace Object type integer can be used to only return objects from a certain DSpace Object type
 void setFacetMinCount(int facetMinCount)
          Set the minimum number of values that need to be present before a valid facet value has been found
 void setFacetOffset(int facetOffset)
          Sets the facet field offset, one facet offset will be used for all the facet fields
 void setMaxResults(int maxResults)
          Sets the maximum number of results by this query
 void setQuery(String query)
           
 void setSortField(String sortField, DiscoverQuery.SORT_ORDER sortOrder)
           
 void setStart(int start)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoverQuery

public DiscoverQuery()
Method Detail

setQuery

public void setQuery(String query)

getQuery

public String getQuery()

getStart

public int getStart()

setStart

public void setStart(int start)

setSortField

public void setSortField(String sortField,
                         DiscoverQuery.SORT_ORDER sortOrder)

getSortField

public String getSortField()

getSortOrder

public DiscoverQuery.SORT_ORDER getSortOrder()

setDSpaceObjectFilter

public void setDSpaceObjectFilter(int DSpaceObjectFilter)
Sets the DSpace object filter, must be an DSpace Object type integer can be used to only return objects from a certain DSpace Object type

Parameters:
DSpaceObjectFilter - the DSpace object filer

getDSpaceObjectFilter

public int getDSpaceObjectFilter()
Gets the DSpace object filter can be used to only return objects from a certain DSpace Object type

Returns:
the DSpace object filer

getMaxResults

public int getMaxResults()
The maximum number of results returned by this query

Returns:
the number of results

setMaxResults

public void setMaxResults(int maxResults)
Sets the maximum number of results by this query

Parameters:
maxResults - the number of results

addFilterQueries

public void addFilterQueries(String... filterQueries)
Adds new filter queries

Parameters:
filterQueries - the filter queries to be added

getFilterQueries

public List<String> getFilterQueries()
Returns the filter queries

Returns:
the filter queries in a list

addFieldPresentQueries

public void addFieldPresentQueries(String... fieldPresentQueries)
Adds a query that will ensure that a certain field is present in the index

Parameters:
fieldPresentQueries - the queries to be added

getFieldPresentQueries

public List<String> getFieldPresentQueries()

addFacetQuery

public void addFacetQuery(String facetQuery)
Adds a new facet query

Parameters:
facetQuery - the new facet query to be added

getFacetQueries

public List<String> getFacetQueries()
Returns the facet queries

Returns:
the facet queries for this query

addFacetField

public void addFacetField(DiscoverFacetField facetField)
Adds a new facet field

Parameters:
facetField - the new facet field to be added

getFacetFields

public List<DiscoverFacetField> getFacetFields()
Gets the facets fields configured

Returns:
the facet fields for this query

getFacetMinCount

public int getFacetMinCount()
Gets the minimum number of values that need to be present before a valid facet value has been found

Returns:
facetMinCount the minimum number of values to be present for a valid facet

setFacetMinCount

public void setFacetMinCount(int facetMinCount)
Set the minimum number of values that need to be present before a valid facet value has been found

Parameters:
facetMinCount - the minimum number of values to be present for a valid facet

getFacetOffset

public int getFacetOffset()
Gets the facet field offset

Returns:
the facet field offset

setFacetOffset

public void setFacetOffset(int facetOffset)
Sets the facet field offset, one facet offset will be used for all the facet fields

Parameters:
facetOffset - an integer representing the offset

addSearchField

public void addSearchField(String field)

getSearchFields

public List<String> getSearchFields()

getProperties

public Map<String,List<String>> getProperties()
Returns the misc search properties

Returns:
a map containing the properties

addProperty

public void addProperty(String property,
                        String value)
Adds a new search property to the misc search properties

Parameters:
property - the name of the property
value - the value of the property

getHitHighlightingField

public DiscoverHitHighlightingField getHitHighlightingField(String field)

getHitHighlightingFields

public List<DiscoverHitHighlightingField> getHitHighlightingFields()

addHitHighlightingField

public void addHitHighlightingField(DiscoverHitHighlightingField hitHighlighting)


Copyright © 2012 DuraSpace. All Rights Reserved.