blob: a7c974332ec975a163b4bb3c7079f1f6de8d160f [file] [log] [blame]
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>SMILA/Documentation/Search - Eclipsepedia</title>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="generator" content="MediaWiki 1.23.2" />
<link rel="shortcut icon" href="http://wiki.eclipse.org/eclipse.org-common/themes/solstice/public/images/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="http://wiki.eclipse.org/opensearch_desc.php" title="Eclipsepedia (en)" />
<link rel="EditURI" type="application/rsd+xml" href="http://wiki.eclipse.org/api.php?action=rsd" />
<link rel="alternate" type="application/atom+xml" title="Eclipsepedia Atom feed" href="http://wiki.eclipse.org/index.php?title=Special:RecentChanges&amp;feed=atom" />
<link rel="canonical" href="../Search.html" />
<link rel="stylesheet" href="http://wiki.eclipse.org/load.php?debug=false&amp;lang=en&amp;modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.ui.button&amp;only=styles&amp;skin=solstice&amp;*" />
<link rel="stylesheet" href="http://wiki.eclipse.org/skins/solstice/public/stylesheets/styles.min.css?303" media="screen, print" /><meta name="ResourceLoaderDynamicStyles" content="" />
<style>a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}
/* cache key: my_wiki:resourceloader:filter:minify-css:7:14ece53a42aa314864e5fd8c57f0d98f */</style>
<script src="http://wiki.eclipse.org/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=solstice&amp;*"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"SMILA/Documentation/Search","wgTitle":"SMILA/Documentation/Search","wgCurRevisionId":374364,"wgRevisionId":374364,"wgArticleId":18950,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["SMILA"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"SMILA/Documentation/Search","wgIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRedirectedFrom":"SMILA/Documentation/2011.Simplification/Search","wgWikiEditorEnabledModules":{"toolbar":false,"dialogs":false,"hidesig":true,"preview":false,"previewDialog":false,"publish":false},"wgCategoryTreePageCategoryOptions":"{\"mode\":0,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}"});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function($,jQuery){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"editfont":"default","editondblclick":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":1,"extendwatchlist":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nickname":"","norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"rcdays":7,"rclimit":50,"rows":25,"showhiddencats":0,"shownumberswatching":1,"showtoolbar":1,"skin":"solstice","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":1,"watchdefault":1,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,
"useeditwarning":1,"prefershttps":1,"language":"en","variant-gan":"gan","variant-iu":"iu","variant-kk":"kk","variant-ku":"ku","variant-shi":"shi","variant-sr":"sr","variant-tg":"tg","variant-uz":"uz","variant-zh":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"variant":"en"});},{},{});mw.loader.implement("user.tokens",function($,jQuery){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});},{},{});
/* cache key: my_wiki:resourceloader:filter:minify-js:7:70d74423d3fc1e1c18fa9a1ff645a84a */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-xml {line-height: normal;}
.source-xml li, .source-xml pre {
line-height: normal; border: 0px none white;
}
/**
* GeSHi Dynamically Generated Stylesheet
* --------------------------------------
* Dynamically generated stylesheet for xml
* CSS class: source-xml, CSS id:
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
* --------------------------------------
*/
.xml.source-xml .de1, .xml.source-xml .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.xml.source-xml {font-family:monospace;}
.xml.source-xml .imp {font-weight: bold; color: red;}
.xml.source-xml li, .xml.source-xml .li1 {font-weight: normal; vertical-align:top;}
.xml.source-xml .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.xml.source-xml .li2 {font-weight: bold; vertical-align:top;}
.xml.source-xml .es0 {color: #000099; font-weight: bold;}
.xml.source-xml .br0 {color: #66cc66;}
.xml.source-xml .sy0 {color: #66cc66;}
.xml.source-xml .st0 {color: #ff0000;}
.xml.source-xml .nu0 {color: #cc66cc;}
.xml.source-xml .sc-1 {color: #808080; font-style: italic;}
.xml.source-xml .sc0 {color: #00bbdd;}
.xml.source-xml .sc1 {color: #ddbb00;}
.xml.source-xml .sc2 {color: #339933;}
.xml.source-xml .sc3 {color: #009900;}
.xml.source-xml .re0 {color: #000066;}
.xml.source-xml .re1 {color: #000000; font-weight: bold;}
.xml.source-xml .re2 {color: #000000; font-weight: bold;}
.xml.source-xml .ln-xtra, .xml.source-xml li.ln-xtra, .xml.source-xml div.ln-xtra {background-color: #ffc;}
.xml.source-xml span.xtra { display:block; }
/*]]>*/
</style><meta name="viewport" content="width=device-width, initial-scale=1.0"></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-SMILA_Documentation_Search skin-solstice action-view" id="solstice">
<a class="sr-only" href="Search.html#content">Skip to main content</a>
<div class="thin-header">
<header role="banner" class="hidden-print noprint">
<div class="container-fluid">
<div id="row-logo-search">
<div id="header-left">
<div class="row">
<div class="hidden-xs col-sm-6 logo-container">
<a href="https://www.eclipse.org/" ><img class="logo-eclipse-default" src="http://wiki.eclipse.org/skins/solstice/public/images/logo/eclipse-800x188.png" alt="Eclipsepedia"></a>
</div>
<div class="navbar col-sm-18 yamm" id="main-menu">
<div class="navbar-collapse collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a target="_self" href="https://eclipse.org/downloads/">Download</a></li>
<li><a target="_self" href="https://eclipse.org/users/">Getting Started </a></li>
<li><a target="_self" href="https://eclipse.org/membership/">Members</a></li>
<li><a target="_self" href="https://eclipse.org/projects/">Projects</a></li>
<li class="dropdown visible-xs"><a class="dropdown-toggle" data-toggle="dropdown" href="Search.html#">Community <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="http://marketplace.eclipse.org">Marketplace</a></li><li><a href="http://events.eclipse.org">Events</a></li><li><a href="http://www.planeteclipse.org/">Planet Eclipse</a></li><li><a href="https://eclipse.org/community/eclipse_newsletter/">Newsletter</a></li><li><a href="https://www.youtube.com/user/EclipseFdn">Videos</a></li></ul></li><li class="dropdown visible-xs"><a class="dropdown-toggle" data-toggle="dropdown" href="Search.html#">Participate <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="https://bugs.eclipse.org/bugs/">Report a Bug</a></li><li><a href="https://eclipse.org/forums/">Forums</a></li><li><a href="https://eclipse.org/mail/">Mailing Lists</a></li><li><a href="https://wiki.eclipse.org/">Wiki</a></li><li><a href="https://wiki.eclipse.org/IRC">IRC</a></li><li><a href="https://eclipse.org/contribute/">How to Contribute</a></li></ul></li><li class="dropdown visible-xs"><a class="dropdown-toggle" data-toggle="dropdown" href="Search.html#">Working Groups <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="http://wiki.eclipse.org/Auto_IWG">Automotive</a></li><li><a href="http://iot.eclipse.org">Internet of Things</a></li><li><a href="http://locationtech.org">LocationTech</a></li><li><a href="http://lts.eclipse.org">Long-Term Support</a></li><li><a href="http://polarsys.org">PolarSys</a></li><li><a href="http://science.eclipse.org">Science</a></li><li><a href="http://openmdm.org">OpenMDM</a></li></ul></li><!-- More -->
<li class="dropdown hidden-xs"><a class="dropdown-toggle" data-toggle="dropdown">More<b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<!-- Content container to add padding -->
<div class="yamm-content">
<div class="row">
<ul class="col-sm-8 list-unstyled"><li><p><strong>Community</strong></p></li><li><a href="http://marketplace.eclipse.org">Marketplace</a></li><li><a href="http://events.eclipse.org">Events</a></li><li><a href="http://www.planeteclipse.org/">Planet Eclipse</a></li><li><a href="https://eclipse.org/community/eclipse_newsletter/">Newsletter</a></li><li><a href="https://www.youtube.com/user/EclipseFdn">Videos</a></li></ul><ul class="col-sm-8 list-unstyled"><li><p><strong>Participate</strong></p></li><li><a href="https://bugs.eclipse.org/bugs/">Report a Bug</a></li><li><a href="https://eclipse.org/forums/">Forums</a></li><li><a href="https://eclipse.org/mail/">Mailing Lists</a></li><li><a href="https://wiki.eclipse.org/">Wiki</a></li><li><a href="https://wiki.eclipse.org/IRC">IRC</a></li><li><a href="https://eclipse.org/contribute/">How to Contribute</a></li></ul><ul class="col-sm-8 list-unstyled"><li><p><strong>Working Groups</strong></p></li><li><a href="http://wiki.eclipse.org/Auto_IWG">Automotive</a></li><li><a href="http://iot.eclipse.org">Internet of Things</a></li><li><a href="http://locationtech.org">LocationTech</a></li><li><a href="http://lts.eclipse.org">Long-Term Support</a></li><li><a href="http://polarsys.org">PolarSys</a></li><li><a href="http://science.eclipse.org">Science</a></li><li><a href="http://openmdm.org">OpenMDM</a></li></ul> </div>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="navbar-header">
<button data-target="#navbar-collapse-1" data-toggle="collapse" class="navbar-toggle" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="https://www.eclipse.org/" class="visible-xs navbar-brand"><img class="logo-eclipse-default" src="http://wiki.eclipse.org/skins/solstice/public/images/logo/eclipse-800x188.png" alt="Eclipsepedia" width="174"></a>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<section class="defaut-breadcrumbs hidden-print noprint hidden-print clearfix" id="breadcrumb">
<div>
<ol class="breadcrumb">
<li><a href="https://www.eclipse.org/">Home</a></li>
<li><a href="http://wiki.eclipse.org/Main_Page">Eclipse Wiki</a></li>
<li class="active">SMILA/Documentation/Search</li></ol>
</div>
</section>
</div>
<div class="toolbar-menu breadcrumbs-offset noprint hidden-print margin-bottom-0 clearfix">
<div class="col-md-24">
<ol class="breadcrumb" role="navigation">
<li id="pt-login">
<a href="http://wiki.eclipse.org/index.php?title=Special:UserLogin&amp;returnto=SMILA%2FDocumentation%2FSearch">
<i class="fa fa-sign-in fa-fw orange"></i> Log in </a>
</li>
</ul>
</div>
</div>
<main role="main" class="background-grey">
<div class="container-full padding-top-25">
<!-- content -->
<section id="content" class="mw-body container-full clearfix 0">
<div id="mw-js-message" style="display:none;"></div>
<!-- bodyContent -->
<div id="bodyContent">
<!-- jumpto -->
<div id="jump-to-nav" class="mw-jump">
Jump to: <a href="Search.html#mw-head">navigation</a>,
<a href="Search.html#p-search">search</a>
</div>
<!-- /jumpto -->
<!-- leftcol -->
<aside class="col-md-4 noprint hidden-print" id="leftcol">
<form class="input-group" role="form" id="form-eclipse-search" action="http://wiki.eclipse.org/index.php" id="searchform">
<input id="searchInput" class="search-query form-control" type="search" accesskey="f" title="Special:Search" placeholder="Search" name="search" value="">
<span class="input-group-btn">
<button value="search" id="mw-searchButton" type="submit" class="btn btn-default" title="Search the pages for this text" name="fulltext">
<i class="fa fa-search"></i>
</button>
</span>
</form>
<select class="form-control margin-top-10 margin-bottom-10 visible-xs visible-sm" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);"><option class="fw-700 "><span class="fw-700">---Navigation---</span></option><option value="/Main_Page">Main Page</option><option value="/Eclipsepedia:Community_portal">Community portal</option><option value="/Eclipsepedia:Current_events">Current events</option><option value="/Special:RecentChanges">Recent changes</option><option value="/Special:Random">Random page</option><option value="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">Help</option></select><ul class="ul-left-nav fa-ul hidden-print leftnav hidden-xs hidden-sm"><li class="separator"><span class="separator">Navigation</span></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Main_Page" id="n-mainpage" title="Visit the main page [z]" accesskey="z">Main Page</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Eclipsepedia:Community_portal" id="n-portal" title="About the project, what you can do, where to find things">Community portal</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Eclipsepedia:Current_events" id="n-currentevents" title="Find background information on current events">Current events</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:RecentChanges" id="n-recentchanges" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:Random" id="n-randompage" title="Load a random page [x]" accesskey="x">Random page</a></li> <li class=""><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" id="n-help" title="The place to find out">Help</a></li></ul> <select class="form-control margin-top-10 margin-bottom-10 visible-xs visible-sm" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);"><option class="fw-700 "><span class="fw-700">---Toolbox---</span></option><option value="/index.php?title=SMILA/Documentation/Search&amp;action=info">Page information</option><option value="/index.php?title=SMILA/Documentation/Search&amp;oldid=374364">Permanent link</option><option value="/index.php?title=SMILA/Documentation/Search&amp;printable=yes">Printable version</option><option value="/Special:SpecialPages">Special pages</option><option value="/Special:RecentChangesLinked/SMILA/Documentation/Search">Related changes</option><option value="/Special:WhatLinksHere/SMILA/Documentation/Search">What links here</option></select><ul class="ul-left-nav fa-ul hidden-print leftnav hidden-xs hidden-sm"><li class="separator"><span class="separator">Toolbox</span></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;action=info" id="t-info">Page information</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;oldid=374364" id="t-permalink" title="Permanent link to this revision of the page">Permanent link</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;printable=yes" id="t-print" rel="alternate" title="Printable version of this page [p]" accesskey="p">Printable version</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:SpecialPages" id="t-specialpages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:RecentChangesLinked/SMILA/Documentation/Search" id="t-recentchangeslinked" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li><li><i class="fa fa-angle-double-right orange fa-fw"></i> <a href="http://wiki.eclipse.org/Special:WhatLinksHere/SMILA/Documentation/Search" id="t-whatlinkshere" title="A list of all wiki pages that link here [j]" accesskey="j">What links here</a></li></ul> </aside>
<!-- /leftcol -->
<!-- mainContent -->
<div id="mainContent" class="col-md-20">
<ul class="nav nav-tabs noprint hidden-print" role="tablist">
<li id="ca-nstab-main" class="selected"><a href="../Search.html" title="View the content page [c]" accesskey="c" tabindex="-1">Page</a></li>
<li id="ca-talk" class="new"><a href="http://wiki.eclipse.org/index.php?title=Talk:SMILA/Documentation/Search&amp;action=edit&amp;redlink=1" title="Discussion about the content page [t]" accesskey="t" tabindex="-1">Discussion</a></li>
<li id="ca-viewsource"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;action=edit" title="This page is protected.&#10;You can view its source [e]" accesskey="e" tabindex="-1">View source</a></li>
<li id="ca-history" class="collapsible"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;action=history" title="Past revisions of this page [h]" accesskey="h" tabindex="-1">History</a></li>
</ul> <div class="tab-content background-white">
<div id="tab-pane-main-page-content" class="tab-pane active">
<h1 id="firstHeading" class="firstHeading page-header">
<span dir="auto">SMILA/Documentation/Search</span>
</h1>
<div id="main-page-content">
<!-- subtitle -->
<div id="contentSub" class="alert alert-small alert-warning"><span class="subpages">&lt; <a href="../../../SMILA.html" title="SMILA">SMILA</a>&lrm; | <a href="../../Documentation.1.html" title="SMILA/Documentation">Documentation</a></span>(Redirected from <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/2011.Simplification/Search&amp;redirect=no" title="SMILA/Documentation/2011.Simplification/Search">SMILA/Documentation/2011.Simplification/Search</a>)</div>
<!-- /subtitle -->
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><p>This page describes the search service and related parts of SMILA. This includes the query and result helpers, the processing of search requests internally, and the sample servlet used to create a simple web-based GUI for search.
</p>
<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="Search.html#Introduction"><span class="tocnumber">1</span> <span class="toctext">Introduction</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="Search.html#Search_Processing"><span class="tocnumber">2</span> <span class="toctext">Search Processing</span></a>
<ul>
<li class="toclevel-2 tocsection-3"><a href="Search.html#Search_Scripts"><span class="tocnumber">2.1</span> <span class="toctext">Search Scripts</span></a></li>
<li class="toclevel-2 tocsection-4"><a href="Search.html#Search_Pipelines"><span class="tocnumber">2.2</span> <span class="toctext">Search Pipelines</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-5"><a href="Search.html#Search_Service_API"><span class="tocnumber">3</span> <span class="toctext">Search Service API</span></a></li>
<li class="toclevel-1 tocsection-6"><a href="Search.html#Query_Parameters"><span class="tocnumber">4</span> <span class="toctext">Query Parameters</span></a></li>
<li class="toclevel-1 tocsection-7"><a href="Search.html#Result_Annotations"><span class="tocnumber">5</span> <span class="toctext">Result Annotations</span></a></li>
<li class="toclevel-1 tocsection-8"><a href="Search.html#Helper_Classes"><span class="tocnumber">6</span> <span class="toctext">Helper Classes</span></a></li>
<li class="toclevel-1 tocsection-9"><a href="Search.html#SMILA_Search_Servlet"><span class="tocnumber">7</span> <span class="toctext">SMILA Search Servlet</span></a>
<ul>
<li class="toclevel-2 tocsection-10"><a href="Search.html#XSLT_Stylesheets_for_SMILA_search_and_result_pages"><span class="tocnumber">7.1</span> <span class="toctext">XSLT Stylesheets for SMILA search and result pages</span></a></li>
<li class="toclevel-2 tocsection-11"><a href="Search.html#Setting_parameters"><span class="tocnumber">7.2</span> <span class="toctext">Setting parameters</span></a></li>
<li class="toclevel-2 tocsection-12"><a href="Search.html#Setting_attributes"><span class="tocnumber">7.3</span> <span class="toctext">Setting attributes</span></a></li>
<li class="toclevel-2 tocsection-13"><a href="Search.html#Setting_other_parameters"><span class="tocnumber">7.4</span> <span class="toctext">Setting other parameters</span></a></li>
<li class="toclevel-2 tocsection-14"><a href="Search.html#Adding_attachments"><span class="tocnumber">7.5</span> <span class="toctext">Adding attachments</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-15"><a href="Search.html#Record_Search_Servlet"><span class="tocnumber">8</span> <span class="toctext">Record Search Servlet</span></a></li>
</ul>
</div>
<h3><span class="mw-headline" id="Introduction">Introduction</span></h3>
<p>Let's start right at the top: Provided that you installed SMILA and created an index by starting a crawler as described in <a href="../../Documentation_for_5_Minutes_to_Success.html" title="SMILA/Documentation for 5 Minutes to Success" class="mw-redirect">5 Minutes to Success</a>, you can use you web browser to go to <a rel="nofollow" class="external free" href="http://localhost:8080/SMILA/search">http://localhost:8080/SMILA/search</a> and search on the index:
</p><p><a href="http://wiki.eclipse.org/File:SMILA-search-page-default.png" class="image" title="SMILA&#39;s sample search page"><img alt="SMILA&#39;s sample search page" src="http://wiki.eclipse.org/images/thumb/8/82/SMILA-search-page-default.png/500px-SMILA-search-page-default.png" width="500" height="427" srcset="/images/thumb/8/82/SMILA-search-page-default.png/750px-SMILA-search-page-default.png 1.5x, /images/thumb/8/82/SMILA-search-page-default.png/1000px-SMILA-search-page-default.png 2x" /></a>
</p><p>What happens behind the scenes when you enter a query string and submit the form, is that, on the server side, a servlet creates a SMILA record from the HTTP parameters, uses the search service to process the search with this record, receives an enriched version of the query record and also a list of result records in XML form, and uses an XSLT stylesheet to create a result page in HTML format.
</p><p>The processing inside the search service is done by calling a simple (builtin) javascript file to do the work .
</p><p>By clicking the <i>Advanced</i> link at the top of the search page (or by entering the URL <tt><a rel="nofollow" class="external free" href="http://localhost:8080/SMILA/search?style=SMILASearchAdvanced">http://localhost:8080/SMILA/search?style=SMILASearchAdvanced</a></tt>), you can switch to a more detailed search form page, which allows you to construct more specific search queries:
</p><p><a href="http://wiki.eclipse.org/File:SMILA-search-page-advanced.png" class="image" title="SMILA&#39;s advanced sample search page"><img alt="SMILA&#39;s advanced sample search page" src="http://wiki.eclipse.org/images/thumb/7/70/SMILA-search-page-advanced.png/500px-SMILA-search-page-advanced.png" width="500" height="427" srcset="/images/thumb/7/70/SMILA-search-page-advanced.png/750px-SMILA-search-page-advanced.png 1.5x, /images/thumb/7/70/SMILA-search-page-advanced.png/1000px-SMILA-search-page-advanced.png 2x" /></a>
</p><p>If you want to use the default search servlet for your own search page, you are encouraged to use the two XSLT files creating these HTML pages as a reference or basis when building your pages.
</p>
<h3><span class="mw-headline" id="Search_Processing">Search Processing</span></h3>
<p>As mentioned before, the internal processing is done via the search service which makes use of javascript for keeping an high level of flexbility. There is also the possibility to use BPEL workflows to steer the query throughout the system. If you want to dig deeper, a more thorough documentation of both concepts can be found at:
</p>
<ul>
<li> <a href="../Scripting.html" title="SMILA/Documentation/Scripting">SMILA/Documentation/Scripting</a> and
</li>
<li> <a href="../BPEL_Workflow_Processor.html" title="SMILA/Documentation/BPEL Workflow Processor">SMILA/Documentation/BPEL Workflow Processor</a>
</li>
</ul>
<p>Since both chapters rather address the indexing side of both concepts, the following two paragraphs provide an explanation of how they're to be used in query scenarios.
</p>
<h4><span class="mw-headline" id="Search_Scripts">Search Scripts</span></h4>
<div class="messagebox" style="background-color: #def3fe; border: 1px solid #c5d7e0; color: black; padding: 5px; margin: 1ex 0; min-height: 35px; padding-left: 45px;">
<div style="float: left; margin-left: -40px;"><a href="http://wiki.eclipse.org/File:Note.png" class="image"><img alt="Note.png" src="http://wiki.eclipse.org/images/c/cc/Note.png" width="35" height="35" /></a></div>
<div><b>Available since SMILA 1.3</b><br />Scripting was introduced in SMILA 1.3</div>
</div>
<p><br />
In the scripting environment, this follows the same record-in, record-out semantics you may already know. Difference is, that the input record contains the query and maybe some additional parameters while the output record holds the search result. The best explanation is given by looking at the actual JS which has been used in the demo search described above. You'll find the file <b>search.js</b> in <b>configuration/org.eclipse.smila.scripting</b>.
</p>
<h4><span class="mw-headline" id="Search_Pipelines">Search Pipelines</span></h4>
<p>Search workflows (or pipelines) look just like indexing pipelines, they are only used a bit differently: Instead of pushing lists of records corresponding to data source objects through them, they are invoked with a single record representing the search request. This record contains the values of the parameters which were defined by the Search API (see below). The request object can be analyzed and enriched with additional information during the workflow before the actual search on the index takes place. The results of this search are not added to the blackboard as records of their own, but are added to the request record under the key "records". Further pipelets may then do further processing based on the request data and the result record list (e.g. highlighting). Finally, the request record including the search results is returned to the client and can be presented.
</p><p>Pipelet invocations look the same as in indexing pipelines. See <tt>SMILA.application/configuration/org.eclipse.smila.processing.bpel/pipelines/searchpipeline.bpel</tt> for a complete example search pipeline (the one used in the above sample).
</p>
<h3><span class="mw-headline" id="Search_Service_API">Search Service API</span></h3>
<p>The actual Search API is quite simple: SMILA registers an OSGi service with the interface <tt>org.eclipse.smila.search.api.SearchService</tt>. It provides a few methods that take a SMILA query record and the name of a search script or workflow as input, execute the script/workflow with the record, and return the result in different formats:
</p>
<div class="messagebox" style="background-color: #def3fe; border: 1px solid #c5d7e0; color: black; padding: 5px; margin: 1ex 0; min-height: 35px; padding-left: 45px;">
<div style="float: left; margin-left: -40px;"><a href="http://wiki.eclipse.org/File:Note.png" class="image"><img alt="Note.png" src="http://wiki.eclipse.org/images/c/cc/Note.png" width="35" height="35" /></a></div>
<div><b>Available since SMILA 1.3</b><br />Scripting was introduced in SMILA 1.3</div>
</div>
<p><br />
</p>
<ul>
<li><tt>Record searchWithScript(String scriptAndFunction, Record query) throws ProcessingException</tt>: This is the basic method of the search service, returning the result records as native SMILA data structures. The other methods call this method for the actual search execution, too, and then just convert the result.
</li>
<li><tt>org.w3c.dom.Document searchAsXmlWithScript(String scriptAndFunction, Record query) throws ProcessingException</tt>: Returns the search result as an XML DOM document. See below for the schema of the result.
</li>
<li><tt>String searchAsXmlStringWithScript(String scriptAndFunction, Record query) throws ProcessingException</tt>: Returns the search result as an XML string. See below for the schema of the result.
</li>
</ul>
<p>The corresponding calls for BPEL are (the same description applies):
</p>
<ul>
<li><tt>Record search(String workflowName, Record query) throws ProcessingException</tt>
</li>
<li><tt>org.w3c.dom.Document searchAsXml(String workflowName, Record query) throws ProcessingException</tt>
</li>
<li><tt>String searchAsXmlString(String workflowName, Record query) throws ProcessingException</tt>
</li>
</ul>
<p>The schema of XML search results is basically as follows (target namespace is <tt><a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/search">http://www.eclipse.org/smila/search</a></tt>, see <tt>org.eclipse.smila.search.api/xml/search.xsd</tt> for the full definition):
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;element</span> <span class="re0">name</span>=<span class="st0">&quot;SearchResult&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;complexType<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;sequence</span> <span class="re0">minOccurs</span>=<span class="st0">&quot;1&quot;</span> <span class="re0">maxOccurs</span>=<span class="st0">&quot;1&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;choice<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;element</span> <span class="re0">name</span>=<span class="st0">&quot;Workflow&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;string&quot;</span> <span class="re0">minOccurs</span>=<span class="st0">&quot;1&quot;</span> <span class="re0">maxOccurs</span>=<span class="st0">&quot;1&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;element</span> <span class="re0">name</span>=<span class="st0">&quot;Script&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;string&quot;</span> <span class="re0">minOccurs</span>=<span class="st0">&quot;1&quot;</span> <span class="re0">maxOccurs</span>=<span class="st0">&quot;1&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;/choice<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;element</span> <span class="re0">ref</span>=<span class="st0">&quot;rec:Record&quot;</span> <span class="re0">minOccurs</span>=<span class="st0">&quot;0&quot;</span> <span class="re0">maxOccurs</span>=<span class="st0">&quot;1&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;/sequence<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/complexType<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/element<span class="re2">&gt;</span></span></span></pre></div></div>
<p>You can view the result XML when using the sample SMILA search page at <tt><a rel="nofollow" class="external free" href="http://localhost:8080/SMILA/search">http://localhost:8080/SMILA/search</a></tt> if you enable the <i>Show XML result</i> option before submitting the query.
</p><p>The content of the query record basically depends a lot on the used search services. However, the Search API also includes a recommendation where to put some basic commonly used search parameters which all index integrations should honor (of course they may specify extensions that are not covered by the generic Search API). The following sections describe these recommendations.
</p>
<h3><span class="mw-headline" id="Query_Parameters">Query Parameters</span></h3>
<p>The query record mainly consists of parameters. The Search API defines the names of these parameters, the allowed values as well as the default values for a set of commonly used parameters. All implementations should use these properties if possible, i.e. they should not introduce additional parameters for the same purpose, but it may be possible that certain parameters are not supported because it is not feasible with the underlying technology. For some parameters we also defined default values. All parameters are single-valued unless otherwise specified.
</p>
<ul>
<li><i>query</i>: Either a search string using a query syntax or a query record describing the query by setting values for attributes (aka fielded search). The implementer for a specific underlying technology may define a query syntax to be able to build complex search criteria in a single string. However, SMILA currently does not define an own query syntax and passes the string as is to its default search engine <a href="../Solr.html" title="SMILA/Documentation/Solr">Solr</a> (see there for handling and interpretation).
<ul>
<li>Example using a query string:
</li>
</ul>
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Record<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Record<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li>Example using a query object (fielded search):
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Record<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;author&quot;</span><span class="re2">&gt;</span></span>shakespeare<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;title&quot;</span><span class="re2">&gt;</span></span>hamlet<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Record<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>maxcount</i>: The maximum number of records which should be returned to the search client. Default value is 10. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;maxcount&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>3<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>offset</i>: The number of hits which, starting from the top, should be skipped in the search result. Default value is 0. Use this parameter to implement result list paging and to provide the user a means to navigate through the result pages: If resultSize=10, the "next page" queries can be identical to the initial query, but with resultOffset=10, 20, ... Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;maxcount&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>3<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;offset&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>3<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>threshold</i>: The minimal value of the relevance score that a result must have to be returned to the search client. Default is 0.0.
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;threshold&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;double&quot;</span><span class="re2">&gt;</span></span>0.5<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>language</i>: The natural language of the query. No default value. This parameter may be required for language-specific pipelets/services that need to know in which language the user is expressing his or her query to be able to deliver feasible results. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>sinn des lebens<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;language&quot;</span><span class="re2">&gt;</span></span>de<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>indexname</i>: Some index services (like Solr) can manage multiple indices at once. When doing so, they can use this parameter to select the index which is to be searched with the current request. However, when using such a scenario, it is recommended to configure a default index name, so that search requests will succeed without having this parameter set explicitly. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;indexname&quot;</span><span class="re2">&gt;</span></span>wikipedia<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>resultAttributes</i>: A multi-valued parameter containing the names of the attributes which the search engine should add to the result records. Since including too many attributes will decrease performance, the list should contain only those attributes that are needed by some pipelets for further processing after the search has taken place or for displaying the results in the end. Omitting the parameter results in getting all available attributes. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;resultAttributes&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val<span class="re2">&gt;</span></span></span>author<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val<span class="re2">&gt;</span></span></span>title<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>highlight</i>: A sequence of string values specifying the attribute names for which highlighting should be returned. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;highlight&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val<span class="re2">&gt;</span></span></span>content<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>sortby</i>: A sequence of maps each containing the <i>key</i> "attribute" (any string) and the <i>key</i> "order" ("ascending" | "descending") specifying that the search result should be sorted by the named attributes in the given order. Omitting this parameter results in a search result sorting by descending relevance (score, similarity, ranking, ....). Multiple maps can be added and should be evaluated in the order of their appearance. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;sortby&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;attribute&quot;</span><span class="re2">&gt;</span></span>year<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;order&quot;</span><span class="re2">&gt;</span></span>descending<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;attribute&quot;</span><span class="re2">&gt;</span></span>author<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;order&quot;</span><span class="re2">&gt;</span></span>ascending<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>facetby</i>: A sequence of maps each containing the <i>key</i> "attribute" (any string) and the <i>key</i> "maxcount" (long). This causes facets to be returned by the search results for the specified attributes, returning "maxcount" values for each attribute. Optionally, each facetby map may contain a map with key "sortby" with keys "order" ("ascending" | "descending") and "criterion" (any string, e.g. "count" or "value") specifying in which order to return the values (e.g. "count" by number of this per facet or "value" by attribute value name). Example:
</li>
</ul>
<div class="messagebox" style="background-color: #def3fe; border: 1px solid #c5d7e0; color: black; padding: 5px; margin: 1ex 0; min-height: 35px; padding-left: 45px;">
<div style="float: left; margin-left: -40px;"><a href="http://wiki.eclipse.org/File:Note.png" class="image"><img alt="Note.png" src="http://wiki.eclipse.org/images/c/cc/Note.png" width="35" height="35" /></a></div>
<div><b>since 1.0</b><br />prior to 1.0 this was named <i>groupby</i> and has been merely renamed, (see <a rel="nofollow" class="external text" href="http://dev.eclipse.org/mhonarc/lists/smila-dev/msg00998.html">mail thread</a></div>
</div>
<p><br />
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;facetby&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;attribute&quot;</span><span class="re2">&gt;</span></span>year<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;maxcount&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>10<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;attribute&quot;</span><span class="re2">&gt;</span></span>author<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;sortby&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;criterion&quot;</span><span class="re2">&gt;</span></span>value<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;order&quot;</span><span class="re2">&gt;</span></span>ascending<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;maxcount&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>5<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>filter</i>: A sequence of maps describing for certain attributes which values they must have in valid result records. Each of the maps contains a <i>key</i> "attribute" and one or more value descriptions:
<ul>
<li>"oneOf", "allOf", "noneOf": sequences of values describing required or forbidden attribute values.
</li>
<li>"atLeast", "atMost", "greaterThan", "lessThan": single values describing lower and upper bounds (including or excluding the bound values) for the attribute value. Example:
</li>
</ul>
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;filter&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;attribute&quot;</span><span class="re2">&gt;</span></span>author<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;oneOf&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val<span class="re2">&gt;</span></span></span>pratchett<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val<span class="re2">&gt;</span></span></span>adams<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;attribute&quot;</span><span class="re2">&gt;</span></span>year<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;atLeast&quot;</span><span class="re2">&gt;</span></span>1990<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;lessThan&quot;</span><span class="re2">&gt;</span></span>2000<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>ranking</i>: A configuration defining how to rank the search results. This is highly depending on the used search engine, so we don't specify this further in SMILA.
</li>
</ul>
<h3><span class="mw-headline" id="Result_Annotations">Result Annotations</span></h3>
<p>The search result is usually the request record, enriched with result data.
</p>
<ul>
<li><i>records</i>: A sequence of maps describing the actual search result, meaning the records retrieved from the index. Each record should have an additional attribute "_weight" describing the relevance score of this record with respect to the query. The size of the "record" sequence is limited by the "maxcount" parameter.
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc-1">&lt;!-- other query parameters --&gt;</span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;records&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_weight&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;double&quot;</span><span class="re2">&gt;</span></span>0.95<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_recordid&quot;</span><span class="re2">&gt;</span></span>file:hamlet<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;title&quot;</span><span class="re2">&gt;</span></span>Hamlet<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;author&quot;</span><span class="re2">&gt;</span></span>Shakespeare<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_weight&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;double&quot;</span><span class="re2">&gt;</span></span>0.90<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_recordid&quot;</span><span class="re2">&gt;</span></span>file:hitchhiker<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;title&quot;</span><span class="re2">&gt;</span></span>Hitchhiker's Guide to the Galaxy<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;author&quot;</span><span class="re2">&gt;</span></span>Adams<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div> <div class="messagebox" style="background-color: #def3fe; border: 1px solid #c5d7e0; color: black; padding: 5px; margin: 1ex 0; min-height: 35px; padding-left: 45px;">
<div style="float: left; margin-left: -40px;"><a href="http://wiki.eclipse.org/File:Note.png" class="image"><img alt="Note.png" src="http://wiki.eclipse.org/images/c/cc/Note.png" width="35" height="35" /></a></div>
<div><b>return binary content</b><br />There is no nice way to return binary content anymore as attachents may only be top-level children of a record. These two solutions are possible:
<ol>
<li> add an attachment to the search record with a name after this pattern: &lt;resultItem-record.Id&gt;.&lt;resultItem.atachmentName&gt;
</li>
<li> convert the byte[] into a string (e.g. base64 encoding, so it is serializable) and return it in the AnyMap</div>
</li>
</ol>
</div>
<p><br />
</p>
<ul>
<li><i>count</i>: The total number of records in the index that have any relevance to the query. Example see <i>runtime</i>.
</li>
<li><i>indexSize</i> (optional): The total number of records in the searched index. Example see <i>runtime</i>.
</li>
<li><i>runtime</i>: The execution time of request in milliseconds, added by the search service. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;count&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>123456<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;indexSize&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>987654321<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;runtime&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>42<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc-1">&lt;!-- other query parameters --&gt;</span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;records&quot;</span><span class="re2">&gt;</span></span>
<span class="sc-1">&lt;!-- contains returned records --&gt;</span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>facets</i>: The faceting results as requested by the <i>facetby</i> parameters. This Map contains a nested Seq for each requested facet and its values.
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;facets&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;year&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;value&quot;</span><span class="re2">&gt;</span></span>2000<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;count&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>42<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;value&quot;</span><span class="re2">&gt;</span></span>2001<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;count&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>21<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;author&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;value&quot;</span><span class="re2">&gt;</span></span>adams<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;count&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>13<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;value&quot;</span><span class="re2">&gt;</span></span>shakespear<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;count&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>17<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span></pre></div></div>
<ul>
<li><i>_highlight</i>: The annotation of the result record, usually used to highlight relevant sections from the result documents in order to allow the user to see at one glance if it suits what he or she was looking for. What is returned here exactly, depends on the used search engine. For example, the Solr integration in SMILA returns the raw form of the text and information about the matching parts to be highlighted. Example:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;records&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;_highlight&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;content&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;text&quot;</span><span class="re2">&gt;</span></span>... To be or not to be ...<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;positions&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;start&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>7<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;end&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>9<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;quality&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>100<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;start&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>20<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;end&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>22<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;quality&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;long&quot;</span><span class="re2">&gt;</span></span>95<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Seq<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span></pre></div></div> Using the HighlightingPipelet this can be transformed into a highlighted text fragment (here using * as the highlight tag): <div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Seq</span> <span class="re0">key</span>=<span class="st0">&quot;records&quot;</span><span class="re2">&gt;</span></span>
<pre> <span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_weight&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;double&quot;</span><span class="re2">&gt;</span></span>0.95<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_recordid&quot;</span><span class="re2">&gt;</span></span>file:hamlet<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;title&quot;</span><span class="re2">&gt;</span></span>Hamlet<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;author&quot;</span><span class="re2">&gt;</span></span>Shakespeare<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;_highlight&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Map</span> <span class="re0">key</span>=<span class="st0">&quot;content&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;text&quot;</span><span class="re2">&gt;</span></span>... To *be* or not to *be* ...<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Map<span class="re2">&gt;</span></span></span>
...
</pre>
<span class="sc3"><span class="re1">&lt;/Map<span class="re2">&gt;</span></span></span></pre></div></div>
<h3><span class="mw-headline" id="Helper_Classes">Helper Classes</span></h3>
<p>There are some classes that help a client to create query records with their annotations and to read result records and their annotation. You can find them in package <tt>org.eclipse.smila.search.api.helper</tt>:
</p>
<ul>
<li><tt>QueryBuilder</tt>: A helper class for building queries and sending the query to search service. Returns a result in the form of the next class:
</li>
<li><tt>ResultAccessor</tt>: A wrapper for the complete search result. Provides methods to access the basic top-level result annotations and to access each search result record wrapped by a:
</li>
<li><tt>ResultRecordAccessor</tt>: Defines methods for accessing some of the result record annotations.
</li>
</ul>
<p>See the source code or JavaDocs for more details on the provided methods.
</p>
<h3><span class="mw-headline" id="SMILA_Search_Servlet">SMILA Search Servlet</span></h3>
<p>In addition to the "search backend", SMILA contains a simple servlet that creates a query record from HTTP parameters and displays the result as an HTML page by converting the XML search result using an XSLT stylesheet. This servlet is intended for quick demos only, not for productive use. It is usually deployed in the Jetty instance that comes with SMILA at <tt>/SMILA/search</tt>. On first invocation, it currently creates a quite empty query record (it sets some default parameters like <i>maxcount</i> etc.) and processes it with the default pipeline "SearchPipeline". The pipeline should be able to process such a query and return an empty result list, not an error. The XML representation of this empty result is then transformed using the default stylesheet ("SMILASearchDefault") to present an initial search page.
</p><p>Note that the servlet actually enriches the XML search result a bit, so the input for the XSLT stylsheet does not completely conform to the defined XML schema. Currently, it adds a section containing the names of indices available in Solr so that the search page can display the names for selection on the left side:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;SearchResult</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://www.eclipse.org/smila/search&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Script<span class="re2">&gt;</span></span></span>search.process<span class="sc3"><span class="re1">&lt;/Script<span class="re2">&gt;</span></span></span>
<span class="sc-1">&lt;!--&gt;'Workflow' instead of 'Script' also possible&lt;--&gt;</span>
<span class="sc3"><span class="re1">&lt;Record</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://www.eclipse.org/smila/record&quot;</span><span class="re2">&gt;</span></span>
<span class="sc-1">&lt;!-- effective query and embedded result records ---&gt;</span>
<span class="sc3"><span class="re1">&lt;/Record<span class="re2">&gt;</span></span></span>
<span class="sc-1">&lt;!-- part added by SearchServlet --&gt;</span>
<span class="sc3"><span class="re1">&lt;IndexNames<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;IndexName<span class="re2">&gt;</span></span></span>test_index<span class="sc3"><span class="re1">&lt;/IndexName<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/IndexNames<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/SearchResult<span class="re2">&gt;</span></span></span></pre></div></div>
<p>You can use the same mechanism to add other information to the XML that is necessary for displaying purposes in the search form but not contained in the search service result: You just have to implement your own servlet or extend the default servlet. Please refer to the source code for details.
</p>
<h4><span class="mw-headline" id="XSLT_Stylesheets_for_SMILA_search_and_result_pages">XSLT Stylesheets for SMILA search and result pages</span></h4>
<p>The stylesheets are loaded from the configuration directory <tt>org.eclipse.smila.search.servlet</tt> and are selected by adding the HTTP parameter "style" to the URL. The value of this parameter must be the filename of the desired stylesheet without the suffix. The file's extension must bei <tt>.xsl</tt>. The servlet currently uses the hardcoded default name "SMILASearchDefault" if no other value was set.
</p><p>In the default application, three stylesheets are avaiable:
</p>
<ul>
<li>SMILASearchDefault: The default search page. Use this as a reference on how to describe simple queries and present result lists, including paging through bigger results.
</li>
<li>SMILASearchAdvanced: Same layout for the result list but demostrates how to create more complex query records with attribute values and filters.
</li>
<li>SMILASearchTest: Primitive layout without paging but demonstrates the setting of even more query features.
</li>
</ul>
<p>To start with another than the default stylesheet, you can add a <i>style</i> parameter to the initial URL. E.g., to start with the "advanced" stylesheet, use: <tt><a rel="nofollow" class="external free" href="http://localhost:8080/SMILA/search?style=SMILASearchAdvanced">http://localhost:8080/SMILA/search?style=SMILASearchAdvanced</a></tt>.
</p><p>In the following we will describe how to set query record features using the servlet. Please have a look at those sample stylesheets for complete examples on how to apply them, as we will not present something like a full tutorial here (-;
</p>
<h4><span class="mw-headline" id="Setting_parameters">Setting parameters</span></h4>
<p>To set a parameter, just use the parameter name as the HTTP parameter name. All values for this HTTP parameter are added to the "parameters" annotation of the query record. E.g., to set the <i>resultSize</i> parameter to 7 using a hidden HTML input field, use:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;resultSize&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;7&quot;</span> <span class="re2">/&gt;</span></span></pre></div></div>
<p>See below for naming rules for the HTTP parameter names to set attribute literals and annotations. Note that you cannot set a parameter with a name that matches one of these rules.
</p>
<h4><span class="mw-headline" id="Setting_attributes">Setting attributes</span></h4>
<p>You can add literal string values to attributes using "A.&lt;AttributeName&gt;" as the HTTP parameter name. E.g., to set a value from an HTML text input field as a literal in attribute "Title", use:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;text&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;A.Title&quot;</span> <span class="re2">/&gt;</span></span></pre></div></div>
<h4><span class="mw-headline" id="Setting_other_parameters">Setting other parameters</span></h4>
<p>To add a "sortby" parameter for an attribute, use "sortBy.&lt;AttributeName&gt;=&lt;order&gt;", e.g.
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;sortby.FileSize&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;descending&quot;</span> <span class="re2">/&gt;</span></span></pre></div></div>
<p>To create a filter for an attribute, use HTTP params:
</p>
<ul>
<li>"F.val.&lt;AttributeName&gt;" to add filter values to an "oneOf" filter.
</li>
<li>"F.min.&lt;AttributeName&gt;" and "F.max.&lt;AttributeName&gt;" to set the lower/upper bounds of an "atLeast"/"atMost" filter.
</li>
</ul>
<p>If both "F.val" and "F.min/F.max" paramaters are set, the servlet will create both an enumeration filter and a range filter with the same filter mode. It depends on the used search engine integration what happens in this case. E.g.
</p>
<ul>
<li>To set a filter for attribute <i>MimeType</i> restricting the result to HTML documents, use:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;F.val.MimeType&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;text/html&quot;</span> <span class="re2">/&gt;</span></span></pre></div></div>
<ul>
<li>To set a filter for attribute <i>FileSize</i> restricting the result to document sizes between 1000 and 10000 bytes, use:
</li>
</ul>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;F.min.FileSize&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;1000&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;F.max.FileSize&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;10000&quot;</span> <span class="re2">/&gt;</span></span></pre></div></div>
<p>To set a value in the ranking parameter for the complete record or an attribute, use "R[.&lt;AttributeName&gt;].&lt;ValueName&gt;". E.g., the following input field adds a parameter "Operator=OR" to attribute "Content":
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;hidden&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;R.Operator.Content&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;OR&quot;</span> <span class="re2">/&gt;</span></span></pre></div></div>
<h4><span class="mw-headline" id="Adding_attachments">Adding attachments</span></h4>
<p>Attachments can be added to the query record by adding file upload fields to the search form, for example:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;input</span> <span class="re0">type</span>=<span class="st0">&quot;file&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;Content&quot;</span><span class="re2">/&gt;</span></span></pre></div></div>
<p>If the user selects a file for this field, it will be uploaded to SMILA and added as attachment "Content". Of course, there must be pipelets in your search pipeline that can process this attachment. Note, that the attachments will be kept in memory in a default SMILA configuration, so they should not be too large.
</p>
<h3><span class="mw-headline" id="Record_Search_Servlet">Record Search Servlet</span></h3>
<p>In addition there exists the very basic Record Search Servlet available at <span style="font-family:monospace;">/SMILA/recordsearch</span>.
</p><p>You can do a POST or GET request on this URL with a SMILA search record in XML representation as the request body. The servlet then parses the given XML and calls the Search Service. The default is to use the SearchPipeline but you can define any other pipeline by adding the <span style="font-family:monospace;">_workflow</span> annotation to the search record with the respective pipeline name:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Record<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_workflow&quot;</span><span class="re2">&gt;</span></span>OtherSearchPipeline<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Record<span class="re2">&gt;</span></span></span></pre></div></div>
<p><br />
To switch to search processing via Javascript, use the annotation <span style="font-family:monospace;">_script</span>:
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;Record<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;query&quot;</span><span class="re2">&gt;</span></span>meaning of life<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Val</span> <span class="re0">key</span>=<span class="st0">&quot;_script&quot;</span><span class="re2">&gt;</span></span>search.process<span class="sc3"><span class="re1">&lt;/Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/Record<span class="re2">&gt;</span></span></span></pre></div></div>
<p><br />
The servlet returns the XML representation of the record returned by the Search Service as is, in which you can find the search results (see above).
</p>
<!--
NewPP limit report
CPU time usage: 0.320 seconds
Real time usage: 0.375 seconds
Preprocessor visited node count: 470/1000000
Preprocessor generated node count: 1014/1000000
Post‐expand include size: 4460/2097152 bytes
Template argument size: 2204/2097152 bytes
Highest expansion depth: 5/40
Expensive parser function count: 0/100
-->
<!-- Saved in parser cache with key my_wiki:pcache:idhash:18950-0!*!0!!en!2!* and timestamp 20150414084540 and revision id 374364
-->
</div>
<!-- catlinks -->
<div id='catlinks' class='catlinks'><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="http://wiki.eclipse.org/Special:Categories" title="Special:Categories">Category</a>: <ul><li><a href="http://wiki.eclipse.org/Category:SMILA" title="Category:SMILA">SMILA</a></li></ul></div></div> <!-- /catlinks -->
</div>
</div>
</div>
</div>
<!-- /maincontent -->
<!-- printfooter -->
<div class="printfooter">
Retrieved from "<a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;oldid=374364">http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;oldid=374364</a>" </div>
<!-- /printfooter -->
<!-- debughtml -->
<!-- /debughtml -->
</div>
<!-- /bodyContent -->
</section>
<!-- /content -->
<!-- footer -->
</div> <section id="footer-contribution-info" style="border-top:1px solid #ccc;" class="footer-offset background-white margin-top-25"><div class="container text-center padding-top-10 padding-bottom-10"><p id="footercredit">This page was last modified 08:58, 28 November 2014 by <a href="http://wiki.eclipse.org/User:Juergen.schumacher.empolis.com" title="User:Juergen.schumacher.empolis.com">Juergen Schumacher</a>. Based on work by <a href="http://wiki.eclipse.org/index.php?title=User:Marco.strack.empolis.com&amp;action=edit&amp;redlink=1" class="new" title="User:Marco.strack.empolis.com (page does not exist)">Marco Strack</a>, <a href="http://wiki.eclipse.org/index.php?title=User:Juergen.schumacher.attensity.com&amp;action=edit&amp;redlink=1" class="new" title="User:Juergen.schumacher.attensity.com (page does not exist)">Juergen Schumacher</a> and <a href="http://wiki.eclipse.org/User:Tmenzel.brox.de" title="User:Tmenzel.brox.de">thomas menzel</a> and <a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Search&amp;action=credits" title="SMILA/Documentation/Search">others</a>.</p><p id="footerviews">This page has been accessed 8,337 times.</p></div></section> </main> <!-- /#main-content-container-row -->
<p id="back-to-top" class="noprint hidden-print">
<a class="visible-xs" href="Search.html#top">Back to the top</a>
</p>
<footer role="contentinfo" class="noprint hidden-print">
<div class="container">
<div class="row">
<section id="footer-eclipse-foundation" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Eclipse Foundation</h2>
<ul class="nav">
<li><a href="https://eclipse.org/org/">About us</a></li>
<li><a href="https://eclipse.org/org/foundation/contact.php">Contact Us</a></li>
<li><a href="https://eclipse.org/donate">Donate</a></li>
<li><a href="https://eclipse.org/org/documents/">Governance</a></li>
<li><a href="https://eclipse.org/artwork/">Logo and Artwork</a></li>
<li><a href="https://eclipse.org/org/foundation/directors.php">Board of Directors</a></li>
</ul>
</section>
<section id="footer-legal" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Legal</h2>
<ul class="nav">
<li><a href="https://eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="https://eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="https://eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="https://eclipse.org/org/documents/epl-v10.php">Eclipse Public License </a></li>
<li><a href="https://eclipse.org/legal/">Legal Resources </a></li>
</ul>
</section>
<section id="footer-useful-links" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Useful Links</h2>
<ul class="nav">
<li><a href="https://bugs.eclipse.org/bugs/">Report a Bug</a></li>
<li><a href="http://help.eclipse.org/">Documentation</a></li>
<li><a href="https://eclipse.org/contribute/">How to Contribute</a></li>
<li><a href="https://eclipse.org/mail/">Mailing Lists</a></li>
<li><a href="https://eclipse.org/forums/">Forums</a></li>
<li><a href="http://marketplace.eclipse.org/">Marketplace</a></li>
</ul>
</section>
<section id="footer-other" class="col-xs-offset-1 col-xs-11 col-sm-7 col-md-6 col-md-offset-0">
<h2 class="section-title">Other</h2>
<ul class="nav">
<li><a href="https://eclipse.org/ide/">IDE and Tools</a></li>
<li><a href="https://eclipse.org/projects">Community of Projects</a></li>
<li><a href="https://eclipse.org/org/workinggroups/">Working Groups</a></li>
</ul>
<ul class="list-inline social-media">
<li><a href="https://twitter.com/EclipseFdn"><i class="fa fa-twitter-square"></i></a></li>
<li><a href="https://plus.google.com/+Eclipse"><i class="fa fa-google-plus-square"></i></a></li>
<li><a href="https://www.facebook.com/eclipse.org"><i class="fa fa-facebook-square"></i> </a></li>
<li><a href="https://www.youtube.com/user/EclipseFdn"><i class="fa fa-youtube-square"></i></a></li>
</ul>
</section>
<div id="copyright" class="col-xs-offset-1 col-sm-14 col-md-24 col-md-offset-0">
<div>
<span><img src="http://eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-logo-bw-800x188.png" alt="Eclipse.org black and white logo" width="166" height="39" id="logo-eclipse-white"/></span>
<p id="copyright-text">Copyright &copy; 2014 The Eclipse Foundation. All Rights Reserved.</p>
</div>
</div>
<a href="Search.html#" class="scrollup">Back to the top</a>
</div>
</div>
</footer>
<script src="http://wiki.eclipse.org/skins/solstice/public/javascript/main.min.js"></script>
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-910670-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script> <!-- /footer -->
<script>/*<![CDATA[*/window.jQuery && jQuery.ready();/*]]>*/</script><script>if(window.mw){
mw.loader.state({"skins.solstice":"loading","site":"ready","user":"ready","user.groups":"ready"});
}</script>
<script src="http://wiki.eclipse.org/load.php?debug=false&amp;lang=en&amp;modules=skins.solstice&amp;only=scripts&amp;skin=solstice&amp;*"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest"],null,true);
}</script>
<script>if(window.mw){
mw.config.set({"wgBackendResponseTime":381});
}</script> </body>
</html>