blob: 9d5e6707098e149ba96734df4f61570d2118ecd9 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>SMILA/Documentation/Solr 4.x - 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="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/Solr_4.x","wgTitle":"SMILA/Documentation/Solr 4.x","wgCurRevisionId":381532,"wgRevisionId":381532,"wgArticleId":47382,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"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/Solr_4.x","wgIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"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>
<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_Solr_4_x skin-solstice action-view" id="solstice">
<a class="sr-only" href="Solr_4.x.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="Solr_4.x.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="Solr_4.x.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="Solr_4.x.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/Solr 4.x</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%2FSolr+4.x">
<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="Solr_4.x.html#mw-head">navigation</a>,
<a href="Solr_4.x.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/Solr_4.x&amp;action=info">Page information</option><option value="/index.php?title=SMILA/Documentation/Solr_4.x&amp;oldid=381532">Permanent link</option><option value="/index.php?title=SMILA/Documentation/Solr_4.x&amp;printable=yes">Printable version</option><option value="/Special:SpecialPages">Special pages</option><option value="/Special:RecentChangesLinked/SMILA/Documentation/Solr_4.x">Related changes</option><option value="/Special:WhatLinksHere/SMILA/Documentation/Solr_4.x">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/Solr_4.x&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/Solr_4.x&amp;oldid=381532" 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/Solr_4.x&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/Solr_4.x" 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/Solr_4.x" 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="active"><a href="Solr_4.x.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/Solr_4.x&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/Solr_4.x&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/Solr_4.x&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/Solr 4.x</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></div>
<!-- /subtitle -->
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="Solr_4.x.html#Configuration"><span class="tocnumber">1</span> <span class="toctext">Configuration</span></a>
<ul>
<li class="toclevel-2 tocsection-2"><a href="Solr_4.x.html#solr-config.json"><span class="tocnumber">1.1</span> <span class="toctext">solr-config.json</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-3"><a href="Solr_4.x.html#Parameters"><span class="tocnumber">2</span> <span class="toctext">Parameters</span></a>
<ul>
<li class="toclevel-2 tocsection-4"><a href="Solr_4.x.html#SolrParams"><span class="tocnumber">2.1</span> <span class="toctext">SolrParams</span></a></li>
<li class="toclevel-2 tocsection-5"><a href="Solr_4.x.html#ImportingParameters"><span class="tocnumber">2.2</span> <span class="toctext">ImportingParameters</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-6"><a href="Solr_4.x.html#Search"><span class="tocnumber">3</span> <span class="toctext">Search</span></a>
<ul>
<li class="toclevel-2 tocsection-7"><a href="Solr_4.x.html#SolrQueryBuilder"><span class="tocnumber">3.1</span> <span class="toctext">SolrQueryBuilder</span></a></li>
<li class="toclevel-2 tocsection-8"><a href="Solr_4.x.html#ResponseParser"><span class="tocnumber">3.2</span> <span class="toctext">ResponseParser</span></a></li>
<li class="toclevel-2 tocsection-9"><a href="Solr_4.x.html#SolrServerService"><span class="tocnumber">3.3</span> <span class="toctext">SolrServerService</span></a></li>
<li class="toclevel-2 tocsection-10"><a href="Solr_4.x.html#SolrServers"><span class="tocnumber">3.4</span> <span class="toctext">SolrServers</span></a></li>
<li class="toclevel-2 tocsection-11"><a href="Solr_4.x.html#CloudServers"><span class="tocnumber">3.5</span> <span class="toctext">CloudServers</span></a></li>
<li class="toclevel-2 tocsection-12"><a href="Solr_4.x.html#EmbeddedServers"><span class="tocnumber">3.6</span> <span class="toctext">EmbeddedServers</span></a></li>
<li class="toclevel-2 tocsection-13"><a href="Solr_4.x.html#RemoteServers"><span class="tocnumber">3.7</span> <span class="toctext">RemoteServers</span></a></li>
<li class="toclevel-2 tocsection-14"><a href="Solr_4.x.html#SolrSearchPipelet"><span class="tocnumber">3.8</span> <span class="toctext">SolrSearchPipelet</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-15"><a href="Solr_4.x.html#Solr_Administration_Handler"><span class="tocnumber">4</span> <span class="toctext">Solr Administration Handler</span></a>
<ul>
<li class="toclevel-2 tocsection-16"><a href="Solr_4.x.html#Collections_API"><span class="tocnumber">4.1</span> <span class="toctext">Collections API</span></a></li>
<li class="toclevel-2 tocsection-17"><a href="Solr_4.x.html#CoreAdmin_API"><span class="tocnumber">4.2</span> <span class="toctext">CoreAdmin API</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-18"><a href="Solr_4.x.html#Update"><span class="tocnumber">5</span> <span class="toctext">Update</span></a>
<ul>
<li class="toclevel-2 tocsection-19"><a href="Solr_4.x.html#SolrDocumentConverter"><span class="tocnumber">5.1</span> <span class="toctext">SolrDocumentConverter</span></a>
<ul>
<li class="toclevel-3 tocsection-20"><a href="Solr_4.x.html#Simple_document_conversion"><span class="tocnumber">5.1.1</span> <span class="toctext">Simple document conversion</span></a></li>
<li class="toclevel-3 tocsection-21"><a href="Solr_4.x.html#Mapping"><span class="tocnumber">5.1.2</span> <span class="toctext">Mapping</span></a></li>
<li class="toclevel-3 tocsection-22"><a href="Solr_4.x.html#Children"><span class="tocnumber">5.1.3</span> <span class="toctext">Children</span></a></li>
<li class="toclevel-3 tocsection-23"><a href="Solr_4.x.html#Document_Boost"><span class="tocnumber">5.1.4</span> <span class="toctext">Document Boost</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-24"><a href="Solr_4.x.html#SolrUpdatePipelet"><span class="tocnumber">5.2</span> <span class="toctext">SolrUpdatePipelet</span></a></li>
</ul>
</li>
</ul>
</div>
<h2><span class="mw-headline" id="Configuration">Configuration</span></h2>
<p>Of the four different ways to run solr, all are prepared but using the SolrCloud will be the most featured.
There is one Class named SolrConfig which is responsible for all those kinds of ways to run solr.
It all depends on the solr-config.json in which way smila is going to connect to solr. Here is an example showing possible configuration parameters and their explanations.
</p>
<h3><span class="mw-headline" id="solr-config.json">solr-config.json</span></h3>
<pre>{
"mode":"cloud",
"idFields":{
"collection1":"id"
},
"restUri":"<a rel="nofollow" class="external free" href="http://localhost:8983/solr/">http://localhost:8983/solr/</a>",
"ResponseParser.fetchFacetFieldType":"false",
"ResponseParser.errors":"THROW",
"CloudSolrServer.zkHost":"localhost:9983",
"CloudSolrServer.updatesToLeaders":"true",
"EmbeddedSolrServer.solrHome":"configuration\\org.eclipse.smila.solr\\solr_home",
"HttpSolrServer.baseUrl":"<a rel="nofollow" class="external free" href="http://localhost:8983/">http://localhost:8983/</a>"
}
</pre>
<ul>
<li> mode: can be cloud, embedded or http - for further details please read on SolrServerService in Search.
</li>
<li> restUri: defines the URI to connect to solr. (for cloud and http only)
</li>
<li> ResponseParser.fetchFacetFieldType: can be either true or false and tells the ResponseParser to either fetch the FacetFieldType or not.
</li>
<li> ResponseParser.errors: tells the ResponseParser what to do if an error occurs. Possible values: IGNORE, LOG, THROW.
</li>
<li> CloudSolrServer.zkHost: takes host and port of the ZooKeeper-server if solr runs in cloud mode with separate ZooKeeper-instance.
</li>
<li> CloudSolrServer.updatesToLeaders: takes a boolean controlling wheather to send updates only to leaders or not. (defaults to true)
</li>
<li> EmbeddedSolrServer.solrHome: states the solr home folder relative to the working directory. (only for embedded)
</li>
<li> HttpSolrServer.baseUrl: takes the base URL for the http solr server.
</li>
</ul>
<p>Since Solr 4 the field name containing the id of a record can be configured for each collection separately. Therefore the map idFields takes collection names as keys and id field names as values.
</p><p><br />
</p>
<h2><span class="mw-headline" id="Parameters">Parameters</span></h2>
<h3><span class="mw-headline" id="SolrParams">SolrParams</span></h3>
<p>The SolrParams class extends the ParameterAccessor off the smila.processing-bundle. Read: <a href="HowTo/How_to_write_a_Pipelet.html" title="SMILA/Documentation/HowTo/How to write a Pipelet">SMILA/Documentation/HowTo/How_to_write_a_Pipelet</a>. Therefore it has the same modular behaviour concerning the source of the configuration. The configuration can be passed via these three ways:
</p>
<ul>
<li> Via Blackboard (global configuration from the pipeline-configuration)
</li>
<li> Via AnyMap
</li>
<li> Via Record (requires blackboard)
</li>
</ul>
<p>Usually getting the configuration off the blackboard is the standard case. This global configuration is valid for all records likewise. But Records can also have their own configuration which then will override the global settings for this very Record. The Record-Configuration doesn't need to be complete. It is sufficient that only those parameters that are different for one Record are stated in the map: _solr.importing .
</p><p>If you put the configuration via AnyMap than only this configuration can be used, because the record-configurations are accessed via the
blackboard.
</p><p>The SolrParams class itself is extended by the following three:
</p>
<ul>
<li> UpdateParams
</li>
</ul>
<p>The parameters accessible via the ImportingParams are used for importing/indexing.
</p>
<dl>
<dt>public Boolean getAttachments(final boolean defaultIfNull)
</dt>
<dd>Will get you if the attachments should be processed or not. The method expects a parameter that states the default if the needed parameter is not available.
</dd>
<dt>public String getServerName()
</dt>
<dd>Will get you the String representation of the name of the Core or the Collection in which the record should be indexed into.
</dd>
<dt>public Integer getCommitWithinMs(final boolean defaultIfNull)
</dt>
<dd>Will get you the maximum time in milliseconds before the next commit happens. The methods expects a parameter for you to choose if you want to get the default value if there is none configured.
</dd>
<dt>public Float getDocumentBoost(final boolean defaultIfNull)
</dt>
<dd>Will get you the boost-factor for the document. The method expects a parameter for you to choose if you want to get the default value if there is none configured.
</dd>
<dt>public AnyMap getMapping(final boolean defaultIfNull)
</dt>
<dd>Will get you the mapping of the fields.The method expects a parameter for you to choose if you want to get the default value if there is none configured.
</dd>
<dt>public Operation getOperation()
</dt>
<dd>Will get you the Operation Enum (mode). Can be: ADD, DELETE_BY_ID, DELETE_BY_QUERY, NONE;
</dd>
<dt>public String getQeuery()
</dt>
<dd>Will return the solr query.
</dd>
</dl>
<ul>
<li> ResponseParams
</li>
</ul>
<p>There is only one parameter here:
</p>
<dl>
<dt>public Integer getQTime()
</dt>
<dd>Returns the time in milliseconds needed for the execution of the query.
</dd>
</dl>
<ul>
<li> SearchParams
</li>
</ul>
<dl>
<dt>public String getServerName()
</dt>
<dd>Returns the String representation of the Core or Collection of the SolrServer that should be used for searching.
</dd>
<dt>public METHOD getMethod()
</dt>
<dd>Returns the HTTP method to use. Can be POST or GET. Defaults to POST.
</dd>
<dt>public String getWorkflow()
</dt>
<dd>Returns the String representation of the workflow name.
</dd>
<dt>public ErrorHandling getErrorHandling()
</dt>
<dd>Returns how an error should be handled. Can be: IGNORE, LOG, THROW. Defaults to IGNORE.
</dd>
<dt>public QueryLogging getQueryLogging()
</dt>
<dd>Returns how the query should be logged. Can be: SMILA, SOLR, BOTH, NONE. Defaults to NONE.
</dd>
</dl>
<h3><span class="mw-headline" id="ImportingParameters">ImportingParameters</span></h3>
<ul>
<li> DocumentBoost: Each document can have its own boost, defaulting to 1.0. The DocumentBoost is part of the importing parameters that are located as follows:
</li>
</ul>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;param&lt;/Val&gt;
&lt;Val key="title"&gt;Parameters&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="documentBoost" type="double"&gt;23.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>Result SolrInputDocument:
</p>
<pre>SolrInputDocument(fields: [_recordid=param, title=Parameters])
DocumentBoost:23.0
</pre>
<p>Other importing parameters can be set via Pipelet-Configuration.
</p>
<ul>
<li> Mapping: The mapping can also be put via the importing parameters:
</li>
</ul>
<pre>&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Map key="mapping"&gt; [...] &lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
</pre>
<ul>
<li> Commit Within Ms
</li>
</ul>
<pre>&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="commitWithinMS"&gt; [...] &lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
</pre>
<ul>
<li> Servername: Describing the solr core or collection name the record(s) should be stored to or read from.
</li>
</ul>
<pre>&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="serverName"&gt; [...] &lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
</pre>
<ul>
<li> Attachments: With this parameter one can set if attachments should be parsed from a record or ignored.
</li>
</ul>
<pre>&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="attachments"&gt; [...] &lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
</pre>
<ul>
<li> Operation: Can be one of the following: ADD, DELETE_BY_ID, DELETE_BY_QUERY, NONE
</li>
</ul>
<pre>&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="operation"&gt; [...] &lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
</pre>
<ul>
<li> Query: The Solr query.
</li>
</ul>
<pre>&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="query"&gt; [...] &lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
</pre>
<h2><span class="mw-headline" id="Search">Search</span></h2>
<h3><span class="mw-headline" id="SolrQueryBuilder">SolrQueryBuilder</span></h3>
<p>The SolrQueryBuilder can be used to build a solr-query programmatically. All fields that smila can use are available as such. Existing documentation can be found here: <a rel="nofollow" class="external free" href="Search.html">http://wiki.eclipse.org/SMILA/Documentation/Search</a>
</p><p>Further (Solr-specific) parameters haven been also included using native parameters.
</p><p>All methods have the SolrQueryBuilder-Instance itself as return value, so daisy-chaining the methods makes it quiet easy to construct a query.
</p><p>For Facetting details please look into the solr-documentation: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Faceting">https://cwiki.apache.org/confluence/display/solr/Faceting</a>
</p><p>For Query details the solr-documentation can be helpful as well: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing">https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing</a>
</p>
<h3><span class="mw-headline" id="ResponseParser">ResponseParser</span></h3>
<p>The ResponseParser takes a SolrResponse (which can either be a SolrResponseBase or a QueryResponse) and translates this data into a Record for further processing within smila.
</p><p>The ResponseParser can be instantiated with either of two constructors:
</p>
<ul>
<li> public ResponseParser(final String workflowName, final Record result, final String idField)
</li>
<li> public ResponseParser(final String workflowName, final Record result, final String idField, final ErrorHandling errors)
</li>
</ul>
<p>The constructors need the workflow name, a Record for storing the result and the name of the idField. The first constructor sets the ErrorHandling to ErrorHandling.IGNORE. The second one expects the ErrorHandling to be given as a parameter. Possible Values are: IGNORE, LOG, THROW.
</p><p>The ResponseParser is able to parse results, facets, grouping, terms, spellcheck, more like this, cursor mark, debug and stats off of the SolrResponse.
</p><p>(<b>TODO:</b> Was kann der Parsen, wie sieht das dann in der smila-struktur aus)
</p>
<h3><span class="mw-headline" id="SolrServerService">SolrServerService</span></h3>
<p>The SolrServerService is implemented as OSGi-Service that uses the default solr-config.json to determine which mode solr is running. Within its activate method CloudServers, EmbeddedServer or RemoteServers are destinguished and stored as reference.
</p><p>Using the getConfig() method returns the configuration from the solr-config.json.
</p><p>Using the getServer(String name) method will return the SolrServer with the given name. SolrServer in this content means the name of the core or the collection depending on the solr-mode.
</p>
<h3><span class="mw-headline" id="SolrServers">SolrServers</span></h3>
<p>SolrServers is the super-class for EmbeddedServers, CloudServers and RemoteServers. It is used for creating and caching solr-servers.
The public method getServer(String name) returns the SolrServer with the given name or throws an SolrServerException if no server with the given name is found. This method also includes a caching mechanism for directly return the SolrServer if it was already created earlier.
Servers can also be removed from the cache using the removeServer(String name) method.
Finally the whole cache can be cleared using the clearCache() method.
As well as from the SolrServerService itself the SolrConfig can also be returned using the getConfig() method off SolrServers.
The abstract method createServer(String name) is implemented within the three Classes stated earlier and are described as follows:
</p>
<h3><span class="mw-headline" id="CloudServers">CloudServers</span></h3>
<p>Using Solr as cloud is likely going to be the most used solr-mode of all. The SolrServer for solr-cloud is created using the createServer(String name) method. This method is used by SolrServer when the method getServer(String name) is called and the solr-mode is cloud. Take a look at the Configuration to see the fields required in solr-config.json.
</p>
<h3><span class="mw-headline" id="EmbeddedServers">EmbeddedServers</span></h3>
<p>Using solr embedded in smila should only be used for testing and development purposes and NOT for production. Solr embedded will not be as high-performance as stand-alone (cloud, remote) and will not have all the features solr offers. As with CloudServers the createServer(String name) method is called by the getServer(String name) method of SolrServers. No special configuration is needed, because no connection to external processes are made. Stating a solr.home-folder in the solr-config.json is nevertheless mandatory.
EmbeddedServers has a CoreContainer that inherits all the SolrServers.
</p>
<h3><span class="mw-headline" id="RemoteServers">RemoteServers</span></h3>
<p>Using solr in remote mode is so-to-say legacy, but still the easiest way to set up solr if no cloud (clustering) is needed. As with CloudServers the createServer(String name) method is called from the getServer(String name) method off SolrServers. Take a look at Configuration to see which fields are required in solr-config.json to make solr work in remote with smila.
</p>
<h3><span class="mw-headline" id="SolrSearchPipelet">SolrSearchPipelet</span></h3>
<p>The SolrSearchPipelet uses the same configuration-fallback-logic that is described in Parameters.
As with all new Pipelets the SolrSearchPipelet can be configured to either drop or fail if one record induces an error. If _dropOnError is not stated it defaults to false.
</p><p>Sample Configuration:
</p>
<pre>&lt;extensionActivity&gt;
&lt;proc:invokePipelet name="SolrSearchPipelet"&gt;
&lt;proc:pipelet class="org.eclipse.smila.solr.search.SolrSearchPipelet" /&gt;
&lt;proc:variables input="request" output="request" /&gt;
&lt;proc:configuration&gt;
&lt;rec:Map key="search"&gt;
&lt;rec:Val key="serverName"&gt;collection1&lt;/rec:Val&gt;
&lt;rec:Val key="method"&gt;GET&lt;/rec:Val&gt;
&lt;rec:Val key="workflow"&gt;SearchPipeline&lt;/rec:Val&gt;
&lt;/rec:Map&gt;
&lt;/proc:configuration&gt;
&lt;/proc:invokePipelet&gt;
&lt;/extensionActivity&gt;
</pre>
<p>The value of the parameter serverName states the core or collection in which the search shall be executed.
The value of the parameter method states whether the request to the solrServer(s) should be requested via HTTP GET or HTTP POST.
The value of the parameter workflow states the name of the workflow in which the SolrSearchPipelet is being executed.
</p><p>How to search
The default solr search handler accepting search records is located at: <a rel="nofollow" class="external free" href="http://localhost:8080/SMILA/recordsearch">http://localhost:8080/SMILA/recordsearch</a>
Basic search
The simplest query available could look like this:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer &lt;/Val&gt;
&lt;/Record&gt;
</pre>
<p>solr query:
Icon
start=0&amp;rows=10&amp;q=Oldtimer
</p><p>This will search for "Oldtimer" in the solr-field defined as "df"-parameter in solrconfig.xml . The string within the query parameter is passed "as-is" to solr. This gives the possibility to use solr/lucene search-syntax without any additional parameters. Take a look at the fielded search for an example. A result could look like this (truncated):
</p>
<pre>&lt;SearchResult xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/search">http://www.eclipse.org/smila/search</a>"&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0" xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-a046ed63-4637-4eab-8b18-c3f0a917e056&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;Val key="id"&gt;E:/TestData/dataECE/Auto/Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;Val key="_source"&gt;file&lt;/Val&gt;
&lt;Seq key="Filename"&gt;&lt;Seq&gt;&lt;Val&gt;Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;&lt;/Seq&gt;&lt;/Seq&gt;
&lt;Val key="MimeType"&gt;application/pdf&lt;/Val&gt;
&lt;Val key="Size"&gt;125433&lt;/Val&gt;
&lt;Val key="LastModifiedDate" type="datetime"&gt;2009-10-29T11:31:16.000+0100&lt;/Val&gt;
&lt;Seq key="Content"&gt;&lt;Seq&gt;&lt;Val/&gt;&lt;/Seq&gt;&lt;/Seq&gt;
&lt;Val key="Extension"&gt;pdf&lt;/Val&gt;
&lt;Val key="_version_" type="long"&gt;1483104970887659520&lt;/Val&gt;
&lt;/Map&gt;
[...]
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;31&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>In the first part of the result the parameters of the given query are returned. Making it easier to debug in case of an unexpected result.
Within the records sequence there are maps representing the result-records with all the field available for one very record.
In the map "_solr" (after [...]) the solr responseHeader and the params (also default params) that were used to create the response are located. Where QTime being the time solr itself needed to calculate the result (transport times between smila and solr are not included) and status "0" meaning the request was successfully processed by solr.
The last two parameters represent the number of records found in total (count) and the number of milliseconds smila and solr (including transport-time between smila and solr) took for creating the result (runtime).
Fielded search
It is also possible to search on specified fields. Two ways to do this are available while using solr with SMILA:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Filename:WWF&lt;/Val&gt;
&lt;/Record&gt;
</pre>
<p>OR
</p>
<pre>&lt;Record&gt;
&lt;Map key="query"&gt;
&lt;Val key="Filename"&gt;WWF&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;q=Filename%3AWWF
</p><p>Now only if the term "WWF" is stated in the field "Filename" the corresponding records are being added to the ResultList:
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Filename:WWF&lt;/Val&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-75c92acb-77e1-4ad9-b00e-b9b90f5d20ef&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\WWF\WWF-Stromkonzept.pdf&lt;/Val&gt;
&lt;Val key="id"&gt;E:/TestData/dataECE/WWF/WWF-Stromkonzept.pdf&lt;/Val&gt;
&lt;Val key="_source"&gt;file&lt;/Val&gt;
&lt;Seq key="Filename"&gt;
&lt;Seq&gt;
&lt;Val&gt;WWF-Stromkonzept.pdf&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Seq&gt;
&lt;Val key="MimeType"&gt;application/pdf&lt;/Val&gt;
&lt;Val key="Size"&gt;67626&lt;/Val&gt;
&lt;Val key="LastModifiedDate" type="datetime"&gt;2009-10-29T10:13:16.000+0100&lt;/Val&gt;
&lt;Seq key="Content"&gt;[...]&lt;/Seq&gt;
&lt;Val key="Extension"&gt;pdf&lt;/Val&gt;
&lt;Val key="_version_" type="long"&gt;1483105029430706176&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;1&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Filename:WWF&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;1&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;11&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>It is also possible to pass multiple terms to on field, e.g.:
</p>
<pre>&lt;Record&gt;
&lt;Map key="query"&gt;
&lt;Seq key="Filename"&gt;
&lt;Val&gt;Eclipse&lt;/Val&gt;
&lt;Val&gt;Process&lt;/Val&gt;
&lt;Val&gt;Framework&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>This will be translated to FileName:(Eclipse Process Framework)
By default the operator for those terms is OR. Still possible but deprecated is to set &lt;solrQueryParser defaultOperator="AND"/&gt; in solrconfig.xml. But the better way to change the operator is adding q.op to the _solr.native Maps, as shown in the next chapter "native params".
Native params
Query strings can also be passed directly to solr using the _solr.native Maps:
</p>
<pre>&lt;Record&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="q"&gt;Oldtimer&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>The result to this query is equivalent to the result of the first example.
solr query
Icon
start=0&amp;rows=10&amp;q=Oldtimer
</p><p>Result attributes
To reduce the amount of data travelling over the wire and also to reduce the amount of computing power needed for the result of a query. The result attributes (fields to return) can be filtered:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Filename:Presseinformation&lt;/Val&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;Content&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=Content&amp;q=Filename%3APresseinformation
</p><p>This will only return the content of the field "Content". As shown the field to be searched on doesn't have to be in the result attributes and still result in a valid and successful query.
The result could look like this (truncated):
</p>
<pre>&lt;SearchResult xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/search">http://www.eclipse.org/smila/search</a>"&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0" xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>"&gt;
&lt;Val key="query"&gt;Filename:Presseinformation&lt;/Val&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;Content&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-89faff78-6b3c-465d-b44e-3e22bd87e107&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Seq key="Content"&gt;
&lt;Seq&gt;
&lt;Val&gt;Oldtimer-Rallye „2000 km durch Deutschland“ im Jahr 2008: [...] &lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;2&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="fl"&gt;Content&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Filename:Presseinformation&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;1&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;21&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Scoring
By default, scoring is disabled. Of course solr does its scoring internally (to determine the order of the results) but it doesn't return the calculated values and therefore disabling scoring by default saves a lot of computing power. Nevertheless scoring can easily be activated by stating the keyword "score" in the result attributes sequence.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;score&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=score&amp;q=Oldtimer
</p><p>This query record will return something like this:
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;score&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-6f551b16-a013-489c-867f-f24da3c01d6f&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="score" type="double"&gt;1.5369712114334106&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="score" type="double"&gt;0.6777405738830566&lt;/Val&gt;
[...]
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="fl"&gt;score&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="maxScore" type="double"&gt;1.5369712114334106&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;17&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>As shown only the score values are returned. If the score is needed in addition to the other fields the resultsAttributes sequence of the search record as shown above needs the value * added (or just the fields that are needed, e.g. _recordid, score).
The response map within the _solr map now shows also the maxScore representing the maximum score over all the records found (not only those that are returned in this very request).
Highlighting
Retrieving a highlighted response is as easy as possible. Only the name of the field that should be used for highlighting has to be stated in the highlight sequence.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Seq key="highlight"&gt;
&lt;Val&gt;text&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=id&amp;q=Oldtimer&amp;hl.fl=text&amp;hl=true
</p><p>This query record returns a solr result like this:
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Seq key="highlight"&gt;
&lt;Val&gt;text&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-0017a1ab-6c8f-4f23-b57b-75396c78143f&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="id"&gt;E:/TestData/dataECE/Auto/Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;Map key="_highlight"&gt;
&lt;Map key="text"&gt;
&lt;Val key="text"&gt;<em>Oldtimer</em>-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
[...]
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;486&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="fl"&gt;id&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="hl.fl"&gt;text&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="hl"&gt;true&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;505&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>As can be seen only the id and the highlighted text field for each result record are returned. If more fields are needed it is necessary to state those in the resultAttributes sequence.
A list of all supportet highlighting-related parameters can be found in the solr documentation: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Highlighting">https://cwiki.apache.org/confluence/display/solr/Highlighting</a>
Little example for getting two snippets per result record instead of default (1):
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Seq key="highlight"&gt;
&lt;Val&gt;text&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="hl.snippets"&gt;2&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=id&amp;q=Oldtimer&amp;hl.fl=text&amp;hl=true&amp;hl.snippets=2
</p><p>maxcount, offset
The maxcount parameter defaults to 10 and limits the number of result records returned per search request.
The offset parameters defines the number of results that should be "skipped" in order to get the further results.
Those parameters can easily be changed:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="maxcount" type="long"&gt;20&lt;/Val&gt;
&lt;Val key="offset" type="long"&gt;20&lt;/Val&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=20&amp;rows=20&amp;q=Oldtimer
</p><p>The preceding query record will retrieve 20 results (if there are) starting with the 21st records. This is so-to-say the 2nd page.
Facetting
All details on facetting with solr can be found in the solr wiki: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Faceting">https://cwiki.apache.org/confluence/display/solr/Faceting</a>
Facets are specified by the map facetby. Three different types of facetting are available. First one is facetting over attribute.
Facets are designed to arrange the search results in categories based on terms found in the index.
Attribute
To use an attribute for facetting the following record with its facetby map will be necessary.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="maxcount"&gt;1&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=1&amp;fl=_recordid&amp;q=Oldtimer&amp;facet.field=Extension&amp;facet=true
</p><p>Again resultAttributes and maxcount 1 are only stated to make the following search result more readable by concerning only values important for this example.
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="maxcount"&gt;1&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-dadce3ba-d7f0-4e26-b383-d062f38e620c&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
[...]
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Map key="facets"&gt;
&lt;Seq key="Extension"&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;doc&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;9&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;pdf&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;1&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;ppt&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;1&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;dwg&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;dxf&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;htm&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;txt&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Seq key="queries"/&gt;
&lt;/Map&gt;
&lt;Val key="runtime" type="long"&gt;2321&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>The facets map contains all "categories" and the number of occurrences within this search.
Range
Fecetting over a range is typically done with date fields.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="range"&gt;Date&lt;/Val&gt;
&lt;Val key="start" type="DateTime"&gt;2009-10-20T10:50:44.000+0100&lt;/Val&gt;
&lt;Val key="end" type="DateTime"&gt;2009-10-22T11:50:44.000+0100&lt;/Val&gt;
&lt;Val key="gap"&gt;+1DAY&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>Solr query
Icon
facet=true&amp;fl=_recordid&amp;f.last_modified.facet.range.gap=%2B1DAY&amp;start=0&amp;f.last_modified.facet.range.end=2009-10-22T10:50:44.000Z&amp;q=Oldtimer&amp;facet.range=last_modified&amp;wt=javabin&amp;version=2&amp;f.last_modified.facet.range.start=2009-10-20T09:50:44.000Z&amp;rows=10
</p><p>The value of the range parameter sets the field upon the facetting should be calculated.
If the range field is a Date, the DateMathParser can NOT be used for describing the range.
Further details on range facets can be found in the solr wiki: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-RangeFaceting">https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-RangeFaceting</a>
The returned result might look like this:
</p>
<pre>&lt;SearchResult xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/search">http://www.eclipse.org/smila/search</a>"&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0" xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="range"&gt;last_modified&lt;/Val&gt;
&lt;Val key="start" type="datetime"&gt;2009-10-20T10:50:44.000+0100&lt;/Val&gt;
&lt;Val key="end" type="datetime"&gt;2009-10-22T11:50:44.000+0100&lt;/Val&gt;
&lt;Val key="gap"&gt;+1DAY&lt;/Val&gt;
&lt;/Map&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-10ea2bbe-8913-4276-a7ba-2de0a12653f0&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Ausnahme für Oldtimer.doc&lt;/Val&gt;
&lt;/Map&gt;
[...]
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="facet"&gt;true&lt;/Val&gt;
&lt;Val key="fl"&gt;_recordid&lt;/Val&gt;
&lt;Val key="f.last_modified.facet.range.gap"&gt;+1DAY&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="f.last_modified.facet.range.end"&gt;2009-10-22T10:50:44.000Z&lt;/Val&gt;
&lt;Val key="q"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="facet.range"&gt;last_modified&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="f.last_modified.facet.range.start"&gt;2009-10-20T09:50:44.000Z&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;10&lt;/Val&gt;
&lt;Map key="facets"&gt;
&lt;Seq key="last_modified"&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;2009-10-20T09:50:44Z&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;2009-10-21T09:50:44Z&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;2009-10-22T09:50:44Z&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Seq key="queries"/&gt;
&lt;/Map&gt;
&lt;Val key="runtime" type="long"&gt;1943&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Query (not yet complete)
Using a query as parameter for calcutaling a facette can be done like this:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="query"&gt;Date&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>Pivot (not yet implemented)
Interval (query working, answer from solr not yet converted)
Fields that should be used for interval faceting need the "docValues" parameter enabled.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;*&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="interval"&gt;Size&lt;/Val&gt;
&lt;Seq key="set"&gt;
&lt;Val&gt;(0,1000)&lt;/Val&gt;
&lt;Val&gt;[1000,10000)&lt;/Val&gt;
&lt;Val&gt;[10000,1000000)&lt;/Val&gt;
&lt;Val&gt;[1000000,*)&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;Val&gt;Size&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
facet=true&amp;fl=_recordid,Size&amp;indent=true&amp;start=0&amp;facet.interval=Size&amp;q=*:*&amp;q=*&amp;_=1418047058873&amp;f.Size.facet.interval.set=(0,1000)&amp;f.Size.facet.interval.set=[1000,10000)&amp;f.Size.facet.interval.set=[10000,1000000)&amp;f.Size.facet.interval.set=[1000000,*)
</p><p>Filtering on Facets
Here is an example for filtering on a facet. The filter can be directly defined within the facetby Map, saving the extra definition for the attribute or range... The filtering on the result attributes are just to clean up the result record below.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;*&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;Seq key="filter"&gt;
&lt;Map&gt;
&lt;Val key="oneOf"&gt;dwg&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;Val&gt;Extension&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>Solr query
Icon
facet=true&amp;fl=_recordid,Extension&amp;start=0&amp;q=*&amp;facet.field=Extension&amp;fq=+(Extension:dwg)&amp;rows=10
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;*&lt;/Val&gt;
&lt;Map key="facetby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;Seq key="filter"&gt;
&lt;Map&gt;
&lt;Val key="oneOf"&gt;dwg&lt;/Val&gt;
&lt;Val key="tag"&gt;tag_Extension&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;Val&gt;Extension&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-2120380d-d138-4900-ac42-461849640099&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\CAD\Antoinette.dwg&lt;/Val&gt;
&lt;Val key="Extension"&gt;dwg&lt;/Val&gt;
&lt;/Map&gt;
[...]
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="facet"&gt;true&lt;/Val&gt;
&lt;Val key="fl"&gt;_recordid,Extension&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;*&lt;/Val&gt;
&lt;Val key="facet.field"&gt;Extension&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="fq"&gt; (Extension:dwg)&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Map key="facets"&gt;
&lt;Seq key="Extension"&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;dwg&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;doc&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
[...]
&lt;/Seq&gt;
&lt;Seq key="queries"/&gt;
&lt;/Map&gt;
&lt;Val key="runtime" type="long"&gt;14&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Grouping
Solr features grouping by using either a field, a function or a query. In this example the field Extension is used to group the results. Function and query searches look similar.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="groupby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="group"&gt;true&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=_recordid&amp;q=Oldtimer&amp;group.field=Extension&amp;group=true
</p><p>It is important that grouping itself is enabled using the _solr.native maps as shown above. Not enabling "group" will cause the groupby map to be ignored by solr.
The resultAttributes are only stated to keep the following search result at a reasonable length and thus to focus on the grouping feature.
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="groupby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;Val key="order"&gt;ascending&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="group"&gt;true&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="qTime" type="long"&gt;0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-1d927085-da0b-4957-a685-21faaa0d4271&lt;/Val&gt;
&lt;Seq key="records"/&gt;
&lt;Map key="groups"&gt;
&lt;Seq key="matches"&gt;
&lt;Val type="long"&gt;11&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Seq key="Extension"&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;pdf&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;1&lt;/Val&gt;
&lt;Seq key="results"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="value"&gt;doc&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;9&lt;/Val&gt;
&lt;Seq key="results"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Ausnahme für Oldtimer.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
[...]
&lt;Val key="runtime" type="long"&gt;2132&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Besides the grouping via attribute grouping via function and via query are also possible. These two parameters can be passed as smila parameters like the attribute in the example above.
All available grouping-parameters can be found in the solr documentation:
<a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Result+Grouping">https://cwiki.apache.org/confluence/display/solr/Result+Grouping</a>
More Like This
The "More Like This"-function off solr can be used to find similar documents for a given query. Details can be found in the solr documentation: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/MoreLikeThis">https://cwiki.apache.org/confluence/display/solr/MoreLikeThis</a>
More Like This is activated by adding the mlt parameter in the _solr.native maps and also stating a field that should be used to calculate the similarity of documents.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;id:"E\:/TestData/dataECE/Auto/Oldtimer Rallye Strecke und Fragen.doc"&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="mlt"&gt;true&lt;/Val&gt;
&lt;Val key="mlt.fl"&gt;text&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;Val&gt;score&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=_recordid%2Cscore&amp;q=id%3A%22E%5C%3A%2FTestData%2FdataECE%2FAuto%2FOldtimer+Rallye+Strecke+und+Fragen.doc%22&amp;mlt=true&amp;mlt.fl=text
</p><p>Stating a value of the uniqueKey field id will result in searching for "more like this" with only one record. Stating a search query that returns mutiple hits will cause solr to calculate "more like this" for each result record independently. Again the resultAttributes parameter is only used to keep this example at a reasonable length.
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;id:"E\:/TestData/dataECE/Auto/Oldtimer Rallye Strecke und Fragen.doc"&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="mlt"&gt;true&lt;/Val&gt;
&lt;Val key="mlt.fl"&gt;text&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="mlt.fl"&gt;text&lt;/Val&gt;
&lt;Val key="fl"&gt;_recordid,score&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;id:"E\:/TestData/dataECE/Auto/Oldtimer Rallye Strecke und Fragen.doc"&lt;/Val&gt;
&lt;Val key="mlt"&gt;true&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="maxScore" type="double"&gt;5.8903489112854&lt;/Val&gt;
&lt;Map key="moreLikeThis"&gt;
&lt;Map key="E:/TestData/dataECE/Auto/Oldtimer Rallye Strecke und Fragen.doc"&gt;
&lt;Val key="numFound" type="long"&gt;57&lt;/Val&gt;
&lt;Val key="start" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="maxScore" type="double"&gt;0.8097046613693237&lt;/Val&gt;
&lt;Seq key="related"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Klimaschutz\HANSA_Meer_Klima_Seerecht_1993.doc&lt;/Val&gt;
&lt;Val key="score" type="double"&gt;0.8097046613693237&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\2000 km Presseinformation 06 08.doc&lt;/Val&gt;
&lt;Val key="score" type="double"&gt;0.7938450574874878&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Klimaschutz\Klimagefaehrdung.doc&lt;/Val&gt;
&lt;Val key="score" type="double"&gt;0.7846448421478271&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Klimaschutz\emission_beschaeftigungswirkung.doc&lt;/Val&gt;
&lt;Val key="score" type="double"&gt;0.6580735445022583&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Klimaschutz\medienmitteilung_20070322.doc&lt;/Val&gt;
&lt;Val key="score" type="double"&gt;0.6203610301017761&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;Val&gt;score&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-fa881498-887e-4459-9583-799972cd5c21&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Oldtimer Rallye Strecke und Fragen.doc&lt;/Val&gt;
&lt;Val key="score" type="double"&gt;5.8903489112854&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Val key="count" type="long"&gt;1&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;19&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>The default number of "more like this" results for each result record is 5. This and other parameters available for solr's more like this feature can be found at the solr wiki: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/MoreLikeThis">https://cwiki.apache.org/confluence/display/solr/MoreLikeThis</a>
Sorting
By default sorting is done by the score in descending order. But the field used for sorting can be altered using the sortby map. This map needs to parameters to set the sorting on a different field. First is attribute which contains the name of the field to sort by and second is the order that specifies the sorting "direction". Both parameters are mandatory and will result in an exception if not set.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="sortby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;Val key="order"&gt;ascending&lt;/Val&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=_recordid&amp;q=Oldtimer&amp;sort=Extension+asc
</p><p>The resultAttrubutes again are only set to keep the focus on sorting and not be distracted by all the other fields that could be returned.
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="sortby"&gt;
&lt;Val key="attribute"&gt;Extension&lt;/Val&gt;
&lt;Val key="order"&gt;ascending&lt;/Val&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-aadeb884-3dde-4f09-ab8b-d63e1e502ea0&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Oldtimer Rallye Strecke und Fragen.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\oldtimer-katalog_tuev_sueddeutschland.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\OldtimerKlassiker.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\oldtimer_versicherung.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\pressetext_havelland_classic_2009.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Reservierung_Chauffeur_PK1-2.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\10_06_2005 Oldtimer-Nachtrallye kommt nach Halle 20_07_.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\2000 km Presseinformation 06 08.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Ausnahme für Oldtimer.doc&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="_recordid"&gt;file:E:\TestData\dataECE\Auto\Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;16&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="sort"&gt;Extension asc&lt;/Val&gt;
&lt;Val key="fl"&gt;_recordid&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;2535&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>If the sortby parameters weren't set, the last item would actually be the first one, because of its highest score.
Debug
Being able to "see" what solr is doing in the background is a new feature of the solr 4 integration. This feature is designed for debugging purposes only and should not be used in production scenario because of high processing load.
Enabling the debug-feature is done like that:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="maxcount" type="long"&gt;1&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="debug"&gt;true&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=1&amp;q=Oldtimer&amp;debug=true
</p><p>Setting the debug parameter to true will return all debug-information. But there is also the possibility to return just parts of the debug-information. Please refer to the Solr Wiki to examine the other options. <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-ThedebugParameter">https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-ThedebugParameter</a>
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="maxcount" type="long"&gt;1&lt;/Val&gt;
&lt;Seq key="highlight"&gt;
&lt;Val&gt;text&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="debug"&gt;true&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="qTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="debug"&gt;
&lt;Val key="rawquerystring"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="querystring"&gt;Oldtimer&lt;/Val&gt;
&lt;Val key="parsedquery"&gt;text:oldtimer&lt;/Val&gt;
&lt;Val key="parsedquery_toString"&gt;text:oldtimer&lt;/Val&gt;
&lt;Map key="explain"&gt;
&lt;Val key="E:/TestData/dataECE/Auto/Oldtimer-Katalog_Tuev_Sued.pdf"&gt;1.5706561 = (MATCH) weight(text:oldtimer in 2) [DefaultSimilarity], result of: 1.5706561 = score(doc=2,freq=1.0 = termFreq=1.0 ), product of: 0.99999994 = queryWeight, product of: 4.1884165 = idf(docFreq=11, maxDocs=291) 0.2387537 = queryNorm 1.5706562 = fieldWeight in 2, product of: 1.0 = tf(freq=1.0), with freq of: 1.0 = termFreq=1.0 4.1884165 = idf(docFreq=11, maxDocs=291) 0.375 = fieldNorm(doc=2)&lt;/Val&gt;
&lt;/Map&gt;
&lt;Val key="QParser"&gt;LuceneQParser&lt;/Val&gt;
&lt;Map key="timing"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;Map key="prepare"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;Map key="query"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="facet"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="mlt"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="highlight"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="stats"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="debug"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Map key="process"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;Map key="query"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="facet"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="mlt"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="highlight"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="stats"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="debug"&gt;
&lt;Val key="time" type="double"&gt;0.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-718f9044-bac3-4cb1-8994-b490dac0bd52&lt;/Val&gt;
&lt;Seq key="records"&gt;
&lt;Map&gt;
&lt;Val key="id"&gt;E:/TestData/dataECE/Auto/Oldtimer-Katalog_Tuev_Sued.pdf&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;23&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Echo Params
For debugging purposes it can be also helpful to see which parameters are used to create the result. This also includes parameters that are no explicitly stated in the query record, but are default values or configured in the solrconfig.xml.
Setting the echoParams to none is the same as not stating the parameter at all
Setting echoParams to explicit defines that the parameters defined in the query should be returned when debug information is returned.
Setting the echoParams to all will cause solr to always return the parameters involved in calculating the result.
Example:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Olktimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="echoParams"&gt;all&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;q=Olktimer&amp;qt=%2Fspell&amp;spellcheck=true&amp;echoParams=all
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Olktimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="echoParams"&gt;all&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="params"&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="df"&gt;text&lt;/Val&gt;
&lt;Val key="spellcheck.maxResultsForSuggest"&gt;5&lt;/Val&gt;
&lt;Val key="spellcheck.collateExtendedResults"&gt;true&lt;/Val&gt;
&lt;Val key="spellcheck.extendedResults"&gt;false&lt;/Val&gt;
&lt;Val key="spellcheck.maxCollations"&gt;5&lt;/Val&gt;
&lt;Val key="spellcheck.maxCollationTries"&gt;10&lt;/Val&gt;
&lt;Seq key="spellcheck.dictionary"&gt;
&lt;Val&gt;default&lt;/Val&gt;
&lt;Val&gt;wordbreak&lt;/Val&gt;
&lt;/Seq&gt;
&lt;Val key="spellcheck.count"&gt;10&lt;/Val&gt;
&lt;Val key="spellcheck.collate"&gt;true&lt;/Val&gt;
&lt;Val key="spellcheck.alternativeTermCount"&gt;5&lt;/Val&gt;
&lt;Val key="echoParams"&gt;all&lt;/Val&gt;
&lt;Val key="start"&gt;0&lt;/Val&gt;
&lt;Val key="q"&gt;Olktimer&lt;/Val&gt;
&lt;Val key="wt"&gt;javabin&lt;/Val&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="version"&gt;2&lt;/Val&gt;
&lt;Val key="rows"&gt;10&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Map key="spellcheck"&gt;
&lt;Map key="suggestions"&gt;
&lt;Map key="olktimer"&gt;
&lt;Val key="numFound" type="long"&gt;2&lt;/Val&gt;
&lt;Val key="startOffset" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="endOffset" type="long"&gt;8&lt;/Val&gt;
&lt;Val key="origFreq" type="long"&gt;0&lt;/Val&gt;
&lt;Seq key="suggestion"&gt;
&lt;Seq&gt;
&lt;Val&gt;oldtimer&lt;/Val&gt;
&lt;Val&gt;oldtimern&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="collations"/&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-6723e9bd-20fd-450e-bf43-8ee2acdff594&lt;/Val&gt;
&lt;Seq key="records"/&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;24&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Spellcheck
The Spellcheck-feature is also know as "did you mean". It tries to "correct" the given query string by looking at the index and calculating the Levenshtein-distance to find similar terms. In the following example the word "Oldtimer" was intentionally written wrong "Olktimer".
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Olktimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="spellcheck.extendedResults"&gt;false&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;q=Olktimer&amp;qt=%2Fspell&amp;spellcheck=true&amp;spellcheck.extendedResults=false
</p><p>By looking at the results, solr shows the expected correction "Oldtimer" and also "oldtimern" which both have a levenshtein-distance of 1 (and therefore are equally "correct" in terms of spellcheck).
Solr search result:
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Olktimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="spellcheck.extendedResults"&gt;false&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;47&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="spellcheck"&gt;
&lt;Map key="suggestions"&gt;
&lt;Map key="olktimer"&gt;
&lt;Val key="numFound" type="long"&gt;2&lt;/Val&gt;
&lt;Val key="startOffset" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="endOffset" type="long"&gt;8&lt;/Val&gt;
&lt;Val key="origFreq" type="long"&gt;0&lt;/Val&gt;
&lt;Seq key="suggestion"&gt;
&lt;Seq&gt;
&lt;Val&gt;oldtimer&lt;/Val&gt;
&lt;Val&gt;oldtimern&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="collations"/&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-cf8075ec-d549-44a5-97a8-a823691f231e&lt;/Val&gt;
&lt;Seq key="records"/&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;65&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Besides the "standard"-result as shown above, extended results can be achieved using the following search record:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Olktimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="spellcheck.extendedResults"&gt;true&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;q=Olktimer&amp;qt=%2Fspell&amp;spellcheck=true&amp;spellcheck.extendedResults=true
</p><p>As can be seen the suggestions are now within a map and the different suggestions itself come with the frequency found within the index.
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Olktimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="qt"&gt;/spell&lt;/Val&gt;
&lt;Val key="spellcheck"&gt;true&lt;/Val&gt;
&lt;Val key="spellcheck.extendedResults"&gt;true&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Map key="responseHeader"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="QTime" type="long"&gt;16&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="spellcheck"&gt;
&lt;Map key="suggestions"&gt;
&lt;Map key="olktimer"&gt;
&lt;Val key="numFound" type="long"&gt;2&lt;/Val&gt;
&lt;Val key="startOffset" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="endOffset" type="long"&gt;8&lt;/Val&gt;
&lt;Val key="origFreq" type="long"&gt;0&lt;/Val&gt;
&lt;Seq key="suggestion"&gt;
&lt;Map&gt;
&lt;Val key="word"&gt;oldtimer&lt;/Val&gt;
&lt;Val key="freq" type="long"&gt;11&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map&gt;
&lt;Val key="word"&gt;oldtimern&lt;/Val&gt;
&lt;Val key="freq" type="long"&gt;4&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Seq&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="collations"/&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Val key="_recordid"&gt;SearchPipeline-b0c2fc68-3264-4c25-9ad4-291c34587c8e&lt;/Val&gt;
&lt;Seq key="records"/&gt;
&lt;Val key="count" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="runtime" type="long"&gt;29&lt;/Val&gt;
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Please refer to the solr documentation on spellchecking for more information on setup and configuration concerning the spellcheck: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/Spell+Checking">https://cwiki.apache.org/confluence/display/solr/Spell+Checking</a>
Stats
The solr stats component returns statistics for numeric, string, and date fields for the search result.
Within the _solr.native maps the property stats has to be true and the stats.field parameter must state a field upon the stats should be calculated.
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="stats"&gt;true&lt;/Val&gt;
&lt;Val key="stats.field"&gt;Size&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;Seq key="resultAttributes"&gt;
&lt;Val&gt;_recordid&lt;/Val&gt;
&lt;/Seq&gt;
&lt;/Record&gt;
</pre>
<p>solr query
Icon
start=0&amp;rows=10&amp;fl=_recordid&amp;q=Oldtimer&amp;stats=true&amp;stats.field=Size
</p>
<pre>&lt;SearchResult&gt;
&lt;Workflow&gt;SearchPipeline&lt;/Workflow&gt;
&lt;Record version="2.0"&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="native"&gt;
&lt;Val key="stats"&gt;true&lt;/Val&gt;
&lt;Val key="stats.field"&gt;Size&lt;/Val&gt;
&lt;/Map&gt;
&lt;Map key="response"&gt;
&lt;Val key="status" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="qTime" type="long"&gt;0&lt;/Val&gt;
&lt;Map key="stats"&gt;
&lt;Map key="Size"&gt;
&lt;Val key="min" type="double"&gt;20992.0&lt;/Val&gt;
&lt;Val key="max" type="double"&gt;3461120.0&lt;/Val&gt;
&lt;Val key="count" type="long"&gt;11&lt;/Val&gt;
&lt;Val key="missing" type="long"&gt;0&lt;/Val&gt;
&lt;Val key="sum" type="double"&gt;4209145.0&lt;/Val&gt;
&lt;Val key="mean" type="double"&gt;382649.54545454547&lt;/Val&gt;
&lt;Val key="stddev" type="double"&gt;1022562.5018264032&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Map&gt;
[...]
&lt;/Record&gt;
&lt;/SearchResult&gt;
</pre>
<p>Further details on the stats feature can be found in the solr wiki at: <a rel="nofollow" class="external free" href="https://cwiki.apache.org/confluence/display/solr/The+Stats+Component">https://cwiki.apache.org/confluence/display/solr/The+Stats+Component</a>
Logging
There are three types of logging the query entered. The SolrSearchPipelet allows to decide whether no logging, smila, solr or both querys to be logged.
By default no logging of the query is activated. Here is an example for logging both smila and solr style query:
</p>
<pre>&lt;Record&gt;
&lt;Val key="query"&gt;Oldtimer&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="search"&gt;
&lt;Val key="serverName"&gt;collection1&lt;/Val&gt;
&lt;Val key="queryLogging"&gt;BOTH&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>Note: By adding the search Map to the _solr Map the defaults of the Map will be overwritten causing to at least state the serverName, so the SolrSearchPipelet knows in which index to search into.
</p><p><br />
</p>
<h2><span class="mw-headline" id="Solr_Administration_Handler">Solr Administration Handler</span></h2>
<p>The SMILA Solr Administration Handler consists of two parts. The first one uses the collections API of solr and has to be used if solr is running as cloud. The second one uses the cores API of solr and has to be used if solr is running stand-alone or embedded. Both are implemented as REST handlers.
</p><p>Most of the calls need parameters like <tt>?name=collection1</tt>
</p><p>Using just the base URL with HTTP GET method will return all possible calls.
</p><p>The actual commands have to be sent as HTTP POST.
</p><p>The examplary parameters are only the mandatory, if not stated otherwise. For full information please look into the solr wiki links.
</p><p><br />
</p>
<h3><span class="mw-headline" id="Collections_API">Collections API</span></h3>
<p>The base URL is: <a rel="nofollow" class="external free" href="http://localhost:8080/solr/admin/collections/COMMAND/">http://localhost:8080/solr/admin/collections/COMMAND/</a>.
</p>
<table class="wikitable">
<tr>
<th> COMMAND
</th>
<th> Description
</th>
<th> Parameters
</th>
<th> Solr Wiki Link
</th></tr>
<tr>
<td>CREATE
</td>
<td> Creates a new collection.
</td>
<td> &#160;?name=newCollection
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api1">[1]</a>
</td></tr>
<tr>
<td> DELETE
</td>
<td> Deletes a existing collection.
</td>
<td> &#160;?name=collectionName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api6">[2]</a>
</td></tr>
<tr>
<td> RELOAD
</td>
<td> Reloads a collection if you have changed a configuration in ZooKeeper.
</td>
<td> &#160;?name=collectionName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api2">[3]</a>
</td></tr>
<tr>
<td> CREATEALIAS
</td>
<td> Creates a new alias pointing to one or more collections.
</td>
<td> &#160;?name=aliasName&amp;collections=collection1,collection2
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api4">[4]</a>
</td></tr>
<tr>
<td> DELETEALIAS
</td>
<td> Deletes an alias.
</td>
<td> &#160;?name=aliasName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api5">[5]</a>
</td></tr>
<tr>
<td> SPLITSHARD
</td>
<td> Splits a shard into two pieces.
</td>
<td> &#160;?collection=collectionName&amp;shard=shardName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api3">[6]</a>
</td></tr>
<tr>
<td> DELETESHARD
</td>
<td> Delets inactice shard.
</td>
<td> &#160;?collection=collectionName&amp;shard=shardName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api7">[7]</a>
</td></tr>
<tr>
<td> CREATESHARD
</td>
<td> Creates a new shard.
</td>
<td> &#160;?collection=collectionName&amp;shard=shardName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api8">[8]</a>
</td></tr>
<tr>
<td> DELETEREPLICA
</td>
<td> Delets a replica from a given collection and shard.
</td>
<td> &#160;?collection=collectionName&amp;shard=shardName&amp;replica=replicaName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api9">[9]</a>
</td></tr>
<tr>
<td> MIGRATE
</td>
<td> Migrates all documents from one collection into another.
</td>
<td> &#160;?collection=collectionName&amp;target.collection=targetNamej&amp;split.key=split
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api12">[10]</a>
</td></tr>
<tr>
<td> ADDROLE
</td>
<td> Assigns a role to a node in the cluser.
</td>
<td> &#160;?role=roleName&amp;node=nodeName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api15AddRole">[11]</a>
</td></tr>
<tr>
<td> REMOVEROLE
</td>
<td> Removes an assigned role from a node.
</td>
<td> &#160;?role=roleName&amp;node=nodeName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api16RemoveRole">[12]</a>
</td></tr>
<tr>
<td> CLUSTERPROP
</td>
<td> Adds, edits or deletes properties of a cluster.
</td>
<td> &#160;?name=propertyName&amp;val=propertyValue
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api11">[13]</a>
</td></tr>
<tr>
<td> REQUESTSTATUS
</td>
<td> Requests the status of an already submitted Collections API Call.
</td>
<td> &#160;?requestid=1000
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-RequestStatus">[14]</a>
</td></tr>
<tr>
<td> ADDREPLICA
</td>
<td> Adds a replica to a shard in a collection.
</td>
<td> &#160;?collection=collectionName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api_addreplica">[15]</a>
</td></tr>
<tr>
<td> OVERSEERSTATUS
</td>
<td> Returns the status of the overseer.
</td>
<td> none
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api17">[16]</a>
</td></tr>
<tr>
<td> LIST
</td>
<td> Returns a list of all collections in the cluster.
</td>
<td> none
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-List">[17]</a>
</td></tr>
<tr>
<td> CLUSTERSTATUS
</td>
<td> Returns the status of a cluster.
</td>
<td> (all optional)&#160;?collection=collectionName&amp;shard=shardName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api18">[18]</a>
</td></tr></table>
<h3><span class="mw-headline" id="CoreAdmin_API">CoreAdmin API</span></h3>
<p>The base URL is: <a rel="nofollow" class="external free" href="http://localhost:8080/solr/admin/cores/COMMAND">http://localhost:8080/solr/admin/cores/COMMAND</a>
</p>
<table class="wikitable">
<tr>
<th> COMMAND
</th>
<th> Description
</th>
<th> Parameters
</th>
<th> Solr Wiki Link
</th></tr>
<tr>
<td> STATUS
</td>
<td> Returns the status of one/all core(s).
</td>
<td> (all optional)&#160;?core=coreName&amp;indexInfo=true
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-STATUS">[19]</a>
</td></tr>
<tr>
<td> UNLOAD
</td>
<td> Removes the given core from solr.
</td>
<td> &#160;?core=name
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-UNLOAD">[20]</a>
</td></tr>
<tr>
<td> RELOAD
</td>
<td> Reloads the configuration of an existing solr core.
</td>
<td> &#160;?core=name
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-RELOAD">[21]</a>
</td></tr>
<tr>
<td> CREATE
</td>
<td> Creates a new core and loads it into solr.
</td>
<td> &#160;?name=coreName&amp;instanceDir=dir/to/solr/core
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-CREATE">[22]</a>
</td></tr>
<tr>
<td> SWAP
</td>
<td> Swaps the name of the solr cores.
</td>
<td> &#160;?core=core1&amp;other=core2
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-SWAP">[23]</a>
</td></tr>
<tr>
<td> RENAME
</td>
<td> Changes the name of a solr core.
</td>
<td> &#160;?core=coreName&amp;other=newName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-RENAME">[24]</a>
</td></tr>
<tr>
<td> MERGEINDEXES
</td>
<td> Merges the content of an index into another index.
</td>
<td> &#160;?core=coreName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-MERGEINDEXES">[25]</a>
</td></tr>
<tr>
<td> SPLIT
</td>
<td> Splits an index into two or more indexes.
</td>
<td> &#160;?core=coreName
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-SPLIT">[26]</a>
</td></tr>
<tr>
<td> REQUESTSTATUS
</td>
<td> Returns the status of an already submitted CoreAdmin API call.
</td>
<td> &#160;?requestid=1000
</td>
<td> <a rel="nofollow" class="external autonumber" href="https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-REQUESTSTATUS">[27]</a>
</td></tr></table>
<h2><span class="mw-headline" id="Update">Update</span></h2>
<h3><span class="mw-headline" id="SolrDocumentConverter">SolrDocumentConverter</span></h3>
<p>The SolrDocumentConverter takes a Record or a List of Records as well as the option for mappings within an AnyMap and converts it to a SolrDocument for further processing with solrj.
</p>
<h4><span class="mw-headline" id="Simple_document_conversion">Simple document conversion</span></h4>
<p>This is maybe the simplest example for the conversion of the SolrDocumentConverter.
</p><p>Using the following method:
</p>
<ul>
<li> public SolrInputDocument toSolrDocument(final Record record)
</li>
</ul>
<p>Record:
</p>
<pre>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;simple&lt;/Val&gt;
&lt;Val key="title"&gt;simple-title&lt;/Val&gt;
&lt;/Record&gt;
</pre>
<p>Converted SolrInputDocument:
</p>
<pre>SolrInputDocument(fields: [_recordid=simple, title=simple-title])
</pre>
<p>Note: No attachments are converted (Of course the shown records has no attachments, but even if it had, none were converted). Please look into the next section if you like to also convert attachments.
</p><p>Attachment: If the values of attachments should be converted also the following method must be used, setting the attachment boolean parameter to true:
</p>
<ul>
<li> public SolrInputDocument toSolrDocument(final Record record, final boolean attachments)
</li>
</ul>
<p>Record:
</p>
<pre>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;recordid&lt;/Val&gt;
&lt;Val key="title"&gt;Record-with-attachment&lt;/Val&gt;
&lt;Attachment&gt;Content&lt;/Attachment&gt;
&lt;/Record&gt;
</pre>
<p>Converted SolrInputDocument:
</p>
<pre>SolrInputDocument(fields: [_recordid=recordid, title=Record-with-attachment, Content=If ever there is tomorrow when we're not together.. there is something you must always remember. you are braver than you believe, stronger than you seem, and smarter than you think. but the most important thing is, even if we're apart.. i'll always be with you.])Sol
</pre>
<h4><span class="mw-headline" id="Mapping">Mapping</span></h4>
<p>The SolrDocumentConverter has the ability to map record-field-names to SolrDocument-field-names using an AnyMap as mapping-map.
One can use the following methods with mapping:
</p>
<ul>
<li> public SolrInputDocument toSolrDocument(final Record record, final AnyMap mapping)
</li>
<li> public SolrInputDocument toSolrDocument(final Record record, final AnyMap mapping, final List&lt;Record&gt; children)
</li>
</ul>
<p>Sample Record (xml):
</p>
<pre>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;mapping&lt;/Val&gt;
&lt;Val key="title"&gt;mapping-title&lt;/Val&gt;
&lt;Val key="description"&gt;mapping-description&lt;/Val&gt;
&lt;Val key="other"&gt;other-contetn&lt;/Val&gt;
&lt;Val key="toAttachment"&gt;attachment-value&lt;/Val&gt;
&lt;Attachment&gt;Content&lt;/Attachment&gt;
&lt;/Record&gt;
</pre>
<p>Sample Mapping (json):
</p>
<pre>{
"title"&#160;: "Title",
"description"&#160;: "",
"other"&#160;: [ "title2", "title3" ],
"Content"&#160;: {
"fieldName"&#160;: "Attachment",
"fieldBoost"&#160;: 23.0,
"type"&#160;: "ATTACHMENT"
}
</pre>
<p>}
</p><p>Sample SolrInputDocument-output:
</p>
<pre>SolrInputDocument(fields: [_recordid=mapping, Title=mapping-title, description=mapping-description, title2=other-contetn, title3=other-contetn, Attachment(23.0)=All your base are belong to us!])
</pre>
<p>As you can see three different kinds of mappings are possible:
</p>
<ul>
<li> Simple Key-Value, meaning "source-field-name":""target-field-name"
</li>
<li> Mapping one source to many targets: "source-field-name": [ "target-field-name1", "target-field-name2" ... ]
</li>
<li> Mapping one source to one target field while adjusting fieldBoost:
</li>
</ul>
<pre>"source-field-name": {
"fieldName":"target-field-name",
"fieldBoost":&lt;FLOAT&gt;,
"type": "ATTACHMENT" or "ATTRIBUTE"
}
</pre>
<p>Note: type defaults to ATTRIBUTE. Meaning it has to be stated if the source field is ATTACHMENT and can be left out if the source field is ATTRIBUTE.
</p>
<h4><span class="mw-headline" id="Children">Children</span></h4>
<p>A new feature of solr 4 is the possibility to have direct relationships between records. To use this feature those documents have to be processed at once with thier parent-children relationship.
</p><p>Use these methods:
</p>
<ul>
<li> public SolrInputDocument toSolrDocument(final Record record, final List&lt;Record&gt; children)
</li>
<li> public SolrInputDocument toSolrDocument(final Record record, final boolean attachments, final List&lt;Record&gt; children)
</li>
<li> public SolrInputDocument toSolrDocument(final Record record, final AnyMap mapping, final List&lt;Record&gt; children)
</li>
</ul>
<p>As you can see children can be combined with mapping and attachments. Note that the mapping is used - if available - for both parent and childrens. Is is also true for the attachments.
</p><p>Example for the combination of attachments, childrens and mapping:
</p><p>Parent:
</p>
<pre>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;parent&lt;/Val&gt;
&lt;Val key="title"&gt;Parent&lt;/Val&gt;
&lt;Attachment&gt;Content&lt;/Attachment&gt;
&lt;/Record&gt;
</pre>
<p>Children:
</p>
<pre>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;child1&lt;/Val&gt;
&lt;Val key="title"&gt;Children1&lt;/Val&gt;
&lt;Val key="desc"&gt;text&lt;/Val&gt;
&lt;Attachment&gt;Content&lt;/Attachment&gt;
&lt;/Record&gt;
&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;child2&lt;/Val&gt;
&lt;Val key="title"&gt;Children2&lt;/Val&gt;
&lt;Attachment&gt;Content&lt;/Attachment&gt;
&lt;/Record&gt;
&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;child3&lt;/Val&gt;
&lt;Val key="title"&gt;Children3&lt;/Val&gt;
&lt;Attachment&gt;Content&lt;/Attachment&gt;
&lt;/Record&gt;
</pre>
<p>Mapping:
</p>
<pre>{
"title"&#160;: "Title",
"description"&#160;: "",
"other"&#160;: [ "title2", "title3" ],
"Content"&#160;: {
"fieldName"&#160;: "Attachment",
"fieldBoost"&#160;: 23.0,
"type"&#160;: "ATTACHMENT"
}
}
</pre>
<p>Result SolrInputDocument:
</p>
<pre>SolrInputDocument(fields: [_recordid=parent, Title=Parent, Attachment(23.0)=parentsContent], children: [SolrInputDocument(fields: [_recordid=child1, Title=Children1, Attachment(23.0)=child1sContent]), SolrInputDocument(fields: [_recordid=child2, Title=Children2, Attachment(23.0)=child2sContent]), SolrInputDocument(fields: [_recordid=child3, Title=Children3, Attachment(23.0)=child3sContent])])
</pre>
<h4><span class="mw-headline" id="Document_Boost">Document Boost</span></h4>
<p>Documents that should generally be higher rated than others can have a boost at the document-level. To do so a map with the key "_solr" has to be added to the metadata-map of the record. This "_solr"-map must contain another map with the key "importing" which then has a key "documentBoost" of which value contains the boost-value. For example:
</p><p>Record:
</p>
<pre>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Record xmlns="<a rel="nofollow" class="external free" href="http://www.eclipse.org/smila/record">http://www.eclipse.org/smila/record</a>" version="2.0"&gt;
&lt;Val key="_recordid"&gt;param&lt;/Val&gt;
&lt;Val key="title"&gt;Parameters&lt;/Val&gt;
&lt;Map key="_solr"&gt;
&lt;Map key="importing"&gt;
&lt;Val key="documentBoost" type="double"&gt;23.0&lt;/Val&gt;
&lt;/Map&gt;
&lt;/Map&gt;
&lt;/Record&gt;
</pre>
<p>Result:
</p>
<pre>SolrInputDocument(fields: [_recordid=param, title=Parameters])
DocumentBoost:23.0
</pre>
<h3><span class="mw-headline" id="SolrUpdatePipelet">SolrUpdatePipelet</span></h3>
<p>The SolrUpdatePipelet uses the same configuration-fallback-logic that is described in Parameters.
</p><p>As with all new Pipelets the SolrUpdatePipelet can be configured to either drop or fail if one record induces an error. If _dropOnError is not stated it defaults to false.
</p><p>The Pipelet has also the ability to process several records at once, reducing Pipelet instantiation and therefore increasing processing speed. Just state the configuration parameter processAsBunch with value true in the Pipeletconfiguration.
</p>
<pre>&lt;extensionActivity&gt;
&lt;proc:invokePipelet name="SolrUpdatePipelet"&gt;
&lt;proc:pipelet class="org.eclipse.smila.solr.update.SolrUpdatePipelet" /&gt;
&lt;proc:variables input="request" output="request" /&gt;
&lt;proc:configuration&gt;
&lt;rec:Map key="update"&gt;
&lt;rec:Val key="indexName"&gt;collection1&lt;/rec:Val&gt;
&lt;rec:Val key="operation"&gt;ADD&lt;/rec:Val&gt;
&lt;rec:Val key="commitWithinMs"&gt;60000&lt;/rec:Val&gt;
&lt;rec:Val key="processAsBunch"&gt;true&lt;/rec:Val&gt;
&lt;rec:Map key="mapping"&gt;
&lt;rec:Val key="_source"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Path"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Url"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Filename"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="MimeType"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Size"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="LastModifiedDate"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Content"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Extension"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Title"&gt;&lt;/rec:Val&gt;
&lt;rec:Val key="Author"&gt;&lt;/rec:Val&gt;
&lt;/rec:Map&gt;
&lt;/rec:Map&gt;
&lt;/proc:configuration&gt;
&lt;/proc:invokePipelet&gt;
&lt;/extensionActivity&gt;
</pre>
<p>The value of the parameter indexName describes the core or collection of the solr-Server in which the records should be indexed.
</p><p>The value of the parameter operation describes if the records should be added, deleted or updated by using the keywords: ADD, DELETE, UPDATE.
</p><p>The value of the parameter commitWithinMs states the maximum time in milliseconds between two commits.
</p><p>The value of the parameter processAsBunch enables the pipelet to put all records within a bunch at once to the solr server. Defaults to false.
</p><p>Assignments of record-fields to solr-fields can be done with the Map mapping. The keys in the Map describe the fields of the record and the values the solr-field the content should be assigned to. If no value is given (as in the example) the record-fields and solr-fields will have the same name. Only fields stated in the Map will be indexed.
</p>
<!--
NewPP limit report
CPU time usage: 0.272 seconds
Real time usage: 0.288 seconds
Preprocessor visited node count: 94/1000000
Preprocessor generated node count: 100/1000000
Post‐expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/100
-->
<!-- Saved in parser cache with key my_wiki:pcache:idhash:47382-0!*!0!!en!*!* and timestamp 20150414084538 and revision id 381532
-->
</div>
<!-- catlinks -->
<div id='catlinks' class='catlinks catlinks-allhidden'></div> <!-- /catlinks -->
</div>
</div>
</div>
</div>
<!-- /maincontent -->
<!-- printfooter -->
<div class="printfooter">
Retrieved from "<a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Solr_4.x&amp;oldid=381532">http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Solr_4.x&amp;oldid=381532</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 09:33, 8 April 2015 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:Pwissel.brox.de&amp;action=edit&amp;redlink=1" class="new" title="User:Pwissel.brox.de (page does not exist)">Peter Wissel</a>.</p><p id="footerviews">This page has been accessed 260 times.</p></div></section> </main> <!-- /#main-content-container-row -->
<p id="back-to-top" class="noprint hidden-print">
<a class="visible-xs" href="Solr_4.x.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="Solr_4.x.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":348});
}</script> </body>
</html>