PHP Class SolrSearchRequest, ojs

Mostra file Open project: pkp/ojs Class Usage Examples

Public Properties

Property Type Description
$_boostFactors A field->value->boost factor assignment.
$_boostFields Fields with multiplicative boost values.
$_excludedIds An array of unique IDs to exclude.
$_facetCategories Enabled facet categories (none by default).
$_fromDate Timestamp representing the first publication date to be included in the result set. Null means: No limitation.
$_highlighting Whether to enable highlighting.
$_itemsPerPage For paginated queries: The items per page.
$_journal The journal to be queried. All journals of an OJS instance will be queried if no journal is given.
$_orderBy Result set ordering. Can be any index field or the pseudo- field "score" for ordering by relevance.
$_orderDir Result set ordering direction. Can be 'true' for ascending or 'false' for descending order.
$_page For paginated queries: The page to be returned.
$_query A field->search phrase assignment defining fieldwise search phrases.
$_spellcheck Whether to enable spell checking.
$_toDate Timestamp representing the last publication date to be included in the result set. Null means: No limitation.

Public Methods

Method Description
__construct ( ) Constructor
addBoostFactor ( $field, $value, $boostFactor ) Set the boost factor for a field/value combination.
addBoostField ( $field ) A field containing boost factors to be multiplied.
addQueryFieldPhrase ( $field, $searchPhrase ) Set the search phrase for a field.
addQueryFromKeywords ( $keywords ) Configure the search request from a keywords array as required by SubmissionSearch::retrieveResults()
getBoostFactors ( ) : array Get boost factors.
getBoostFields ( ) : array Get boost fields.
getExcludedIds ( ) : array Get the list of excluded unique IDs.
getFacetCategories ( ) : array For which categories should faceting be enabled?
getFromDate ( ) : string Get the first publication date
getHighlighting ( ) : boolean Is highlighting enabled?
getItemsPerPage ( ) : integer Get the items per page.
getJournal ( ) : Journal Get the journal to be queried.
getOrderBy ( ) : string Get the result ordering criteria
getOrderDir ( ) : boolean Get the result ordering direction
getPage ( ) : integer Get the page.
getQuery ( ) : array Get fieldwise search phrases.
getSpellcheck ( ) : boolean Is spellchecking enabled?
getToDate ( ) : string Get the last publication date
setBoostFactors ( $boostFactors ) Set boost factors.
setBoostFields ( $boostFields ) Set boost fields.
setExcludedIds ( $excludedIds ) Set a list of unique IDs to exclude from the search result.
setFacetCategories ( $facetCategories ) Set the categories for which faceting should be enabled.
setFromDate ( $fromDate ) Set the first publication date
setHighlighting ( $highlighting ) Set whether highlighting should be enabled.
setItemsPerPage ( $itemsPerPage ) Set the items per page
setJournal ( &$journal ) Set the journal to be queried
setOrderBy ( $orderBy ) Set the result ordering criteria
setOrderDir ( $orderDir ) Set the result ordering direction
setPage ( $page ) Set the page
setQuery ( $query ) Set fieldwise search phrases.
setSpellcheck ( $spellcheck ) Set whether spellchecking should be enabled.
setToDate ( $toDate ) Set the last publication date

Method Details

__construct() public method

Constructor
public __construct ( )

addBoostFactor() public method

Set the boost factor for a field/value combination.
public addBoostFactor ( $field, $value, $boostFactor )
$field string
$value string
$boostFactor float

addBoostField() public method

with the internal ranking score.
public addBoostField ( $field )
$field string

addQueryFieldPhrase() public method

Set the search phrase for a field.
public addQueryFieldPhrase ( $field, $searchPhrase )
$field string
$searchPhrase string

addQueryFromKeywords() public method

Configure the search request from a keywords array as required by SubmissionSearch::retrieveResults()
public addQueryFromKeywords ( $keywords )
$keywords array See SubmissionSearch::retrieveResults()

getBoostFactors() public method

Get boost factors.
public getBoostFactors ( ) : array
return array A field -> value -> boost factor assignment

getBoostFields() public method

Get boost fields.
public getBoostFields ( ) : array
return array A list of fields containing boost factors to be multiplied with the internal ranking score.

getExcludedIds() public method

Get the list of excluded unique IDs.
public getExcludedIds ( ) : array
return array

getFacetCategories() public method

For which categories should faceting be enabled?
public getFacetCategories ( ) : array
return array

getFromDate() public method

Get the first publication date
public getFromDate ( ) : string
return string

getHighlighting() public method

Is highlighting enabled?
public getHighlighting ( ) : boolean
return boolean

getItemsPerPage() public method

Get the items per page.
public getItemsPerPage ( ) : integer
return integer

getJournal() public method

Get the journal to be queried.
public getJournal ( ) : Journal
return Journal

getOrderBy() public method

Get the result ordering criteria
public getOrderBy ( ) : string
return string

getOrderDir() public method

Get the result ordering direction
public getOrderDir ( ) : boolean
return boolean

getPage() public method

Get the page.
public getPage ( ) : integer
return integer

getQuery() public method

Get fieldwise search phrases.
public getQuery ( ) : array
return array A field -> search phrase assignment

getSpellcheck() public method

Is spellchecking enabled?
public getSpellcheck ( ) : boolean
return boolean

getToDate() public method

Get the last publication date
public getToDate ( ) : string
return string

setBoostFactors() public method

Set boost factors.
public setBoostFactors ( $boostFactors )

setBoostFields() public method

Set boost fields.
public setBoostFields ( $boostFields )
$boostFields array A list of fields containing boost factors to be multiplied with the internal ranking score.

setExcludedIds() public method

Set a list of unique IDs to exclude from the search result.
public setExcludedIds ( $excludedIds )
$excludedIds array

setFacetCategories() public method

Set the categories for which faceting should be enabled.
public setFacetCategories ( $facetCategories )
$facetCategories boolean

setFromDate() public method

Set the first publication date
public setFromDate ( $fromDate )
$fromDate string

setHighlighting() public method

Set whether highlighting should be enabled.
public setHighlighting ( $highlighting )
$highlighting boolean

setItemsPerPage() public method

Set the items per page
public setItemsPerPage ( $itemsPerPage )
$itemsPerPage integer

setJournal() public method

Set the journal to be queried
public setJournal ( &$journal )
$journal Journal

setOrderBy() public method

Set the result ordering criteria
public setOrderBy ( $orderBy )
$orderBy string

setOrderDir() public method

Set the result ordering direction
public setOrderDir ( $orderDir )
$orderDir boolean

setPage() public method

Set the page
public setPage ( $page )
$page integer

setQuery() public method

Set fieldwise search phrases.
public setQuery ( $query )
$query array A field -> search phrase assignment

setSpellcheck() public method

Set whether spellchecking should be enabled.
public setSpellcheck ( $spellcheck )
$spellcheck boolean

setToDate() public method

Set the last publication date
public setToDate ( $toDate )
$toDate string

Property Details

$_boostFactors public_oe property

A field->value->boost factor assignment.
public $_boostFactors

$_boostFields public_oe property

Fields with multiplicative boost values.
public $_boostFields

$_excludedIds public_oe property

An array of unique IDs to exclude.
public $_excludedIds

$_facetCategories public_oe property

Enabled facet categories (none by default).
public $_facetCategories

$_fromDate public_oe property

Timestamp representing the first publication date to be included in the result set. Null means: No limitation.
public $_fromDate

$_highlighting public_oe property

Whether to enable highlighting.
public $_highlighting

$_itemsPerPage public_oe property

For paginated queries: The items per page.
public $_itemsPerPage

$_journal public_oe property

The journal to be queried. All journals of an OJS instance will be queried if no journal is given.
public $_journal

$_orderBy public_oe property

Result set ordering. Can be any index field or the pseudo- field "score" for ordering by relevance.
public $_orderBy

$_orderDir public_oe property

Result set ordering direction. Can be 'true' for ascending or 'false' for descending order.
public $_orderDir

$_page public_oe property

For paginated queries: The page to be returned.
public $_page

$_query public_oe property

A field->search phrase assignment defining fieldwise search phrases.
public $_query

$_spellcheck public_oe property

Whether to enable spell checking.
public $_spellcheck

$_toDate public_oe property

Timestamp representing the last publication date to be included in the result set. Null means: No limitation.
public $_toDate