Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
API:EPrints/Plugin/Search
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==METHODS== <!-- Pod2Wiki=head_new --> ===new=== <source lang="perl">$searchexp = EPrints::Plugin::Search->new( session => $session, dataset => $dataset, %opts ) </source> : Create a new Search plugin object. Options: <pre> custom_order - stringified order specification qs - quality score</pre> <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_from_form --> ===from_form=== <source lang="perl">@probs = $searchexp->from_form() </source> : Populate the query from an input form. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_from_cache --> ===from_cache=== <source lang="perl">$ok = $searchexp->from_cache( $id ) </source> : Retrieve an existing query from a cache identified by $id. : The cache id is set via the [[API:EPrints/List|EPrints::List]] object returned by [[API:EPrints/Plugin/Search#execute|execute]] (cache_id option). <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_from_string --> ===from_string=== <source lang="perl">$ok = $searchexp->from_string( $exp ) </source> : Populate the search values from a previously [[API:EPrints/Plugin/Search#serialise|serialise]]d query $exp. : Will only set search values for those fields that have already been defined. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_from_string_raw --> ===from_string_raw=== <source lang="perl">$searchexp->from_string_raw( $exp ) </source> : Populate the search values from a previously [[API:EPrints/Plugin/Search#serialise|serialise]]d query $exp. : This will add any [[API:EPrints/Search/Field|EPrints::Search::Field]]s that are in $exp. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_from_string_fields --> ===from_string_fields=== <source lang="perl">$searchexp->from_string_fields( $fields, %opts ) </source> : Populate the field values from serialised $fields (array ref). : Options: <pre> init - initialise the fields</pre> <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_from_string_filters --> ===from_string_filters=== <source lang="perl">$searchexp->from_string_filters( $fields, %opts ) </source> : Populate the filter field values from serialised $fields (array ref). : Options: <pre> init - initialise the fields</pre> <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_serialise --> ===serialise=== <source lang="perl">$exp = $searchexp->serialise( %opts ) </source> : Serialise the query and return it as a plain-string. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_serialise_fields --> ===serialise_fields=== <source lang="perl">@fields = $searchexp->serialise_fields() </source> : Returns a list of serialised field-values. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_serialise_filters --> ===serialise_filters=== <source lang="perl">@fields = $searchexp->serialise_filters() </source> : Returns a list of serialised filter field-values. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_freeze --> ===freeze=== <source lang="perl">$spec = $searchexp->freeze() </source> : Freeze this search spec. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_thaw --> ===thaw=== <source lang="perl">$searchexp = $searchexp->thaw( $spec ) </source> : Unthaw a search spec into a new [[API:EPrints/Plugin/Search|EPrints/Plugin/Search]] object. <pre> $searchexp = $repo->plugin( "Search" )->thaw( ... );</pre> : Returns undef if $spec is invalid. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_is_blank --> ===is_blank=== <source lang="perl">$searchexp->is_blank() </source> : Returns true if no query has been specified (ignoring any dataset-specific filters). <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_clear --> ===clear=== <source lang="perl">$searchexp->clear() </source> : Clears values from the query from e.g. [[API:EPrints/Plugin/Search#from_form|from_form]]. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_execute --> ===execute=== <source lang="perl">$results = $searchexp->execute() </source> : Execute the query and return a [[API:EPrints/List|EPrints::List]] object (or subclass). <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_render_description --> ===render_description=== <source lang="perl">$xhtml = $searchexp->render_description() </source> : Return an XHTML DOM description of this search expression. This is the combination of the condition and sort options. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_render_conditions_description --> ===render_conditions_description=== <source lang="perl">$xhtml = $searchexp->render_conditions_description() </source> : Return an XHTML DOM description of this search expression's conditions. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_render_order_description --> ===render_order_description=== <source lang="perl">$xhtml = $searchexp->render_order_description() </source> : Return an XHTML DOM description of how this search is ordered. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_render_simple_fields --> ===render_simple_fields=== <source lang="perl">$xhtml = $searchexp->render_simple_fields( [ %opts ] ) </source> : Renders the form input field(s) required for a simple search (typically just a single text input box). : Options are as passed to [[API:EPrints/XHTML#input_field|EPrints::XHTML/input_field]]. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_render_advanced_fields --> ===render_advanced_fields=== <source lang="perl">$xhtml = $searchexp->render_advanced_fields() </source> : Renders a list of input fields for advanced input as table rows. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_join_exp --> ===join_exp=== <source lang="perl">$exp = $searchexp->join_exp( @sections ) </source> <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_split_exp --> ===split_exp=== <source lang="perl">@sections = $searchexp->split_exp( $exp ) </source> <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_describe --> ===describe=== <source lang="perl">$text = $searchexp->describe </source> : Returns a text string describing this search query that will be executed (for debugging). <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_see_also -->
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)