Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example.xsl URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example.xsl?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example.xsl (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example.xsl Mon Mar 31 23:31:37 2014 @@ -0,0 +1,132 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + --> + +<!-- + Simple transform of Solr query results to HTML + --> +<xsl:stylesheet version='1.0' + xmlns:xsl='http://www.w3.org/1999/XSL/Transform' +> + + <xsl:output media-type="text/html" encoding="UTF-8"/> + + <xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/> + + <xsl:template match='/'> + <html> + <head> + <title><xsl:value-of select="$title"/></title> + <xsl:call-template name="css"/> + </head> + <body> + <h1><xsl:value-of select="$title"/></h1> + <div class="note"> + This has been formatted by the sample "example.xsl" transform - + use your own XSLT to get a nicer page + </div> + <xsl:apply-templates select="response/result/doc"/> + </body> + </html> + </xsl:template> + + <xsl:template match="doc"> + <xsl:variable name="pos" select="position()"/> + <div class="doc"> + <table width="100%"> + <xsl:apply-templates> + <xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param> + </xsl:apply-templates> + </table> + </div> + </xsl:template> + + <xsl:template match="doc/*[@name='score']" priority="100"> + <xsl:param name="pos"></xsl:param> + <tr> + <td class="name"> + <xsl:value-of select="@name"/> + </td> + <td class="value"> + <xsl:value-of select="."/> + + <xsl:if test="boolean(//lst[@name='explain'])"> + <xsl:element name="a"> + <!-- can't allow whitespace here --> + <xsl:attribute name="href">javascript:toggle("<xsl:value-of select="concat('exp-',$pos)" />");</xsl:attribute>?</xsl:element> + <br/> + <xsl:element name="div"> + <xsl:attribute name="class">exp</xsl:attribute> + <xsl:attribute name="id"> + <xsl:value-of select="concat('exp-',$pos)" /> + </xsl:attribute> + <xsl:value-of select="//lst[@name='explain']/str[position()=$pos]"/> + </xsl:element> + </xsl:if> + </td> + </tr> + </xsl:template> + + <xsl:template match="doc/arr" priority="100"> + <tr> + <td class="name"> + <xsl:value-of select="@name"/> + </td> + <td class="value"> + <ul> + <xsl:for-each select="*"> + <li><xsl:value-of select="."/></li> + </xsl:for-each> + </ul> + </td> + </tr> + </xsl:template> + + + <xsl:template match="doc/*"> + <tr> + <td class="name"> + <xsl:value-of select="@name"/> + </td> + <td class="value"> + <xsl:value-of select="."/> + </td> + </tr> + </xsl:template> + + <xsl:template match="*"/> + + <xsl:template name="css"> + <script> + function toggle(id) { + var obj = document.getElementById(id); + obj.style.display = (obj.style.display != 'block') ? 'block' : 'none'; + } + </script> + <style type="text/css"> + body { font-family: "Lucida Grande", sans-serif } + td.name { font-style: italic; font-size:80%; } + td { vertical-align: top; } + ul { margin: 0px; margin-left: 1em; padding: 0px; } + .note { font-size:80%; } + .doc { margin-top: 1em; border-top: solid grey 1px; } + .exp { display: none; font-family: monospace; white-space: pre; } + </style> + </xsl:template> + +</xsl:stylesheet>
Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_atom.xsl URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_atom.xsl?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_atom.xsl (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_atom.xsl Mon Mar 31 23:31:37 2014 @@ -0,0 +1,67 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + --> + +<!-- + Simple transform of Solr query results to Atom + --> + +<xsl:stylesheet version='1.0' + xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> + + <xsl:output + method="xml" + encoding="utf-8" + media-type="application/xml" + /> + + <xsl:template match='/'> + <xsl:variable name="query" select="response/lst[@name='responseHeader']/lst[@name='params']/str[@name='q']"/> + <feed xmlns="http://www.w3.org/2005/Atom"> + <title>Example Solr Atom 1.0 Feed</title> + <subtitle> + This has been formatted by the sample "example_atom.xsl" transform - + use your own XSLT to get a nicer Atom feed. + </subtitle> + <author> + <name>Apache Solr</name> + <email>[email protected]</email> + </author> + <link rel="self" type="application/atom+xml" + href="http://localhost:8983/solr/q={$query}&wt=xslt&tr=atom.xsl"/> + <updated> + <xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/> + </updated> + <id>tag:localhost,2007:example</id> + <xsl:apply-templates select="response/result/doc"/> + </feed> + </xsl:template> + + <!-- search results xslt --> + <xsl:template match="doc"> + <xsl:variable name="id" select="str[@name='id']"/> + <entry> + <title><xsl:value-of select="str[@name='name']"/></title> + <link href="http://localhost:8983/solr/select?q={$id}"/> + <id>tag:localhost,2007:<xsl:value-of select="$id"/></id> + <summary><xsl:value-of select="arr[@name='features']"/></summary> + <updated><xsl:value-of select="date[@name='timestamp']"/></updated> + </entry> + </xsl:template> + +</xsl:stylesheet> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_rss.xsl URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_rss.xsl?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_rss.xsl (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/example_rss.xsl Mon Mar 31 23:31:37 2014 @@ -0,0 +1,66 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + --> + +<!-- + Simple transform of Solr query results to RSS + --> + +<xsl:stylesheet version='1.0' + xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> + + <xsl:output + method="xml" + encoding="utf-8" + media-type="application/xml" + /> + <xsl:template match='/'> + <rss version="2.0"> + <channel> + <title>Example Solr RSS 2.0 Feed</title> + <link>http://localhost:8983/solr</link> + <description> + This has been formatted by the sample "example_rss.xsl" transform - + use your own XSLT to get a nicer RSS feed. + </description> + <language>en-us</language> + <docs>http://localhost:8983/solr</docs> + <xsl:apply-templates select="response/result/doc"/> + </channel> + </rss> + </xsl:template> + + <!-- search results xslt --> + <xsl:template match="doc"> + <xsl:variable name="id" select="str[@name='id']"/> + <xsl:variable name="timestamp" select="date[@name='timestamp']"/> + <item> + <title><xsl:value-of select="str[@name='name']"/></title> + <link> + http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/> + </link> + <description> + <xsl:value-of select="arr[@name='features']"/> + </description> + <pubDate><xsl:value-of select="$timestamp"/></pubDate> + <guid> + http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/> + </guid> + </item> + </xsl:template> +</xsl:stylesheet> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/luke.xsl URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/luke.xsl?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/luke.xsl (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/luke.xsl Mon Mar 31 23:31:37 2014 @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + + +<!-- + Display the luke request handler with graphs + --> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/1999/xhtml" + version="1.0" + > + <xsl:output + method="html" + encoding="UTF-8" + media-type="text/html" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + /> + + <xsl:variable name="title">Solr Luke Request Handler Response</xsl:variable> + + <xsl:template match="/"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <link rel="stylesheet" type="text/css" href="solr-admin.css"/> + <link rel="icon" href="favicon.ico" type="image/ico"/> + <link rel="shortcut icon" href="favicon.ico" type="image/ico"/> + <title> + <xsl:value-of select="$title"/> + </title> + <xsl:call-template name="css"/> + + </head> + <body> + <h1> + <xsl:value-of select="$title"/> + </h1> + <div class="doc"> + <ul> + <xsl:if test="response/lst[@name='index']"> + <li> + <a href="#index">Index Statistics</a> + </li> + </xsl:if> + <xsl:if test="response/lst[@name='fields']"> + <li> + <a href="#fields">Field Statistics</a> + <ul> + <xsl:for-each select="response/lst[@name='fields']/lst"> + <li> + <a href="#{@name}"> + <xsl:value-of select="@name"/> + </a> + </li> + </xsl:for-each> + </ul> + </li> + </xsl:if> + <xsl:if test="response/lst[@name='doc']"> + <li> + <a href="#doc">Document statistics</a> + </li> + </xsl:if> + </ul> + </div> + <xsl:if test="response/lst[@name='index']"> + <h2><a name="index"/>Index Statistics</h2> + <xsl:apply-templates select="response/lst[@name='index']"/> + </xsl:if> + <xsl:if test="response/lst[@name='fields']"> + <h2><a name="fields"/>Field Statistics</h2> + <xsl:apply-templates select="response/lst[@name='fields']"/> + </xsl:if> + <xsl:if test="response/lst[@name='doc']"> + <h2><a name="doc"/>Document statistics</h2> + <xsl:apply-templates select="response/lst[@name='doc']"/> + </xsl:if> + </body> + </html> + </xsl:template> + + <xsl:template match="lst"> + <xsl:if test="parent::lst"> + <tr> + <td colspan="2"> + <div class="doc"> + <xsl:call-template name="list"/> + </div> + </td> + </tr> + </xsl:if> + <xsl:if test="not(parent::lst)"> + <div class="doc"> + <xsl:call-template name="list"/> + </div> + </xsl:if> + </xsl:template> + + <xsl:template name="list"> + <xsl:if test="count(child::*)>0"> + <table> + <thead> + <tr> + <th colspan="2"> + <p> + <a name="{@name}"/> + </p> + <xsl:value-of select="@name"/> + </th> + </tr> + </thead> + <tbody> + <xsl:choose> + <xsl:when + test="@name='histogram'"> + <tr> + <td colspan="2"> + <xsl:call-template name="histogram"/> + </td> + </tr> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </tbody> + </table> + </xsl:if> + </xsl:template> + + <xsl:template name="histogram"> + <div class="doc"> + <xsl:call-template name="barchart"> + <xsl:with-param name="max_bar_width">50</xsl:with-param> + <xsl:with-param name="iwidth">800</xsl:with-param> + <xsl:with-param name="iheight">160</xsl:with-param> + <xsl:with-param name="fill">blue</xsl:with-param> + </xsl:call-template> + </div> + </xsl:template> + + <xsl:template name="barchart"> + <xsl:param name="max_bar_width"/> + <xsl:param name="iwidth"/> + <xsl:param name="iheight"/> + <xsl:param name="fill"/> + <xsl:variable name="max"> + <xsl:for-each select="int"> + <xsl:sort data-type="number" order="descending"/> + <xsl:if test="position()=1"> + <xsl:value-of select="."/> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="bars"> + <xsl:value-of select="count(int)"/> + </xsl:variable> + <xsl:variable name="bar_width"> + <xsl:choose> + <xsl:when test="$max_bar_width < ($iwidth div $bars)"> + <xsl:value-of select="$max_bar_width"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$iwidth div $bars"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <table class="histogram"> + <tbody> + <tr> + <xsl:for-each select="int"> + <td> + <xsl:value-of select="."/> + <div class="histogram"> + <xsl:attribute name="style">background-color: <xsl:value-of select="$fill"/>; width: <xsl:value-of select="$bar_width"/>px; height: <xsl:value-of select="($iheight*number(.)) div $max"/>px;</xsl:attribute> + </div> + </td> + </xsl:for-each> + </tr> + <tr> + <xsl:for-each select="int"> + <td> + <xsl:value-of select="@name"/> + </td> + </xsl:for-each> + </tr> + </tbody> + </table> + </xsl:template> + + <xsl:template name="keyvalue"> + <xsl:choose> + <xsl:when test="@name"> + <tr> + <td class="name"> + <xsl:value-of select="@name"/> + </td> + <td class="value"> + <xsl:value-of select="."/> + </td> + </tr> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="int|bool|long|float|double|uuid|date"> + <xsl:call-template name="keyvalue"/> + </xsl:template> + + <xsl:template match="arr"> + <tr> + <td class="name"> + <xsl:value-of select="@name"/> + </td> + <td class="value"> + <ul> + <xsl:for-each select="child::*"> + <li> + <xsl:apply-templates/> + </li> + </xsl:for-each> + </ul> + </td> + </tr> + </xsl:template> + + <xsl:template match="str"> + <xsl:choose> + <xsl:when test="@name='schema' or @name='index' or @name='flags'"> + <xsl:call-template name="schema"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="keyvalue"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="schema"> + <tr> + <td class="name"> + <xsl:value-of select="@name"/> + </td> + <td class="value"> + <xsl:if test="contains(.,'unstored')"> + <xsl:value-of select="."/> + </xsl:if> + <xsl:if test="not(contains(.,'unstored'))"> + <xsl:call-template name="infochar2string"> + <xsl:with-param name="charList"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </td> + </tr> + </xsl:template> + + <xsl:template name="infochar2string"> + <xsl:param name="i">1</xsl:param> + <xsl:param name="charList"/> + + <xsl:variable name="char"> + <xsl:value-of select="substring($charList,$i,1)"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="$char='I'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='I']"/> - </xsl:when> + <xsl:when test="$char='T'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='T']"/> - </xsl:when> + <xsl:when test="$char='S'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='S']"/> - </xsl:when> + <xsl:when test="$char='M'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='M']"/> - </xsl:when> + <xsl:when test="$char='V'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='V']"/> - </xsl:when> + <xsl:when test="$char='o'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='o']"/> - </xsl:when> + <xsl:when test="$char='p'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='p']"/> - </xsl:when> + <xsl:when test="$char='O'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='O']"/> - </xsl:when> + <xsl:when test="$char='L'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='L']"/> - </xsl:when> + <xsl:when test="$char='B'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='B']"/> - </xsl:when> + <xsl:when test="$char='C'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='C']"/> - </xsl:when> + <xsl:when test="$char='f'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='f']"/> - </xsl:when> + <xsl:when test="$char='l'"> + <xsl:value-of select="/response/lst[@name='info']/lst/str[@name='l']"/> - + </xsl:when> + </xsl:choose> + + <xsl:if test="not($i>=string-length($charList))"> + <xsl:call-template name="infochar2string"> + <xsl:with-param name="i"> + <xsl:value-of select="$i+1"/> + </xsl:with-param> + <xsl:with-param name="charList"> + <xsl:value-of select="$charList"/> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </xsl:template> + <xsl:template name="css"> + <style type="text/css"> + <![CDATA[ + td.name {font-style: italic; font-size:80%; } + .doc { margin: 0.5em; border: solid grey 1px; } + .exp { display: none; font-family: monospace; white-space: pre; } + div.histogram { background: none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;} + table.histogram { width: auto; vertical-align: bottom; } + table.histogram td, table.histogram th { text-align: center; vertical-align: bottom; border-bottom: 1px solid #ff9933; width: auto; } + ]]> + </style> + </xsl:template> +</xsl:stylesheet> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/updateXml.xsl URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/updateXml.xsl?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/updateXml.xsl (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/conf/xslt/updateXml.xsl Mon Mar 31 23:31:37 2014 @@ -0,0 +1,70 @@ +<!-- + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + --> + +<!-- + Simple transform of Solr query response into Solr Update XML compliant XML. + When used in the xslt response writer you will get UpdaateXML as output. + But you can also store a query response XML to disk and feed this XML to + the XSLTUpdateRequestHandler to index the content. Provided as example only. + See http://wiki.apache.org/solr/XsltUpdateRequestHandler for more info + --> +<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> + <xsl:output media-type="text/xml" method="xml" indent="yes"/> + + <xsl:template match='/'> + <add> + <xsl:apply-templates select="response/result/doc"/> + </add> + </xsl:template> + + <!-- Ignore score (makes no sense to index) --> + <xsl:template match="doc/*[@name='score']" priority="100"> + </xsl:template> + + <xsl:template match="doc"> + <xsl:variable name="pos" select="position()"/> + <doc> + <xsl:apply-templates> + <xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param> + </xsl:apply-templates> + </doc> + </xsl:template> + + <!-- Flatten arrays to duplicate field lines --> + <xsl:template match="doc/arr" priority="100"> + <xsl:variable name="fn" select="@name"/> + + <xsl:for-each select="*"> + <xsl:element name="field"> + <xsl:attribute name="name"><xsl:value-of select="$fn"/></xsl:attribute> + <xsl:value-of select="."/> + </xsl:element> + </xsl:for-each> + </xsl:template> + + + <xsl:template match="doc/*"> + <xsl:variable name="fn" select="@name"/> + + <xsl:element name="field"> + <xsl:attribute name="name"><xsl:value-of select="$fn"/></xsl:attribute> + <xsl:value-of select="."/> + </xsl:element> + </xsl:template> + + <xsl:template match="*"/> +</xsl:stylesheet> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/core.properties URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/core.properties?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/core.properties (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/oodt-fm/core.properties Mon Mar 31 23:31:37 2014 @@ -0,0 +1 @@ +name=oodt-fm Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/solr.xml URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/solr.xml?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/solr.xml (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/solr.xml Mon Mar 31 23:31:37 2014 @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + This is an example of a simple "solr.xml" file for configuring one or + more Solr Cores, as well as allowing Cores to be added, removed, and + reloaded via HTTP requests. + + More information about options available in this configuration file, + and Solr Core administration can be found online: + http://wiki.apache.org/solr/CoreAdmin +--> + +<solr> + + <solrcloud> + <str name="host">${host:}</str> + <int name="hostPort">${jetty.port:8983}</int> + <str name="hostContext">${hostContext:solr}</str> + <int name="zkClientTimeout">${zkClientTimeout:30000}</int> + <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool> + </solrcloud> + + <shardHandlerFactory name="shardHandlerFactory" + class="HttpShardHandlerFactory"> + <int name="socketTimeout">${socketTimeout:0}</int> + <int name="connTimeout">${connTimeout:0}</int> + </shardHandlerFactory> + +</solr> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/zoo.cfg URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/zoo.cfg?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/zoo.cfg (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/solr/src/main/resources/zoo.cfg Mon Mar 31 23:31:37 2014 @@ -0,0 +1,17 @@ +# The number of milliseconds of each tick +tickTime=2000 +# The number of ticks that the initial +# synchronization phase can take +initLimit=10 +# The number of ticks that can pass between +# sending a request and getting an acknowledgement +syncLimit=5 + +# the directory where the snapshot is stored. +# dataDir=/opt/zookeeper/data +# NOTE: Solr defaults the dataDir to <solrHome>/zoo_data + +# the port at which the clients will connect +# clientPort=2181 +# NOTE: Solr sets this based on zkRun / zkHost params + Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/pom.xml URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/pom.xml?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/pom.xml (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/pom.xml Mon Mar 31 23:31:37 2014 @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>${groupId}</groupId> + <artifactId>${rootArtifactId}</artifactId> + <version>${version}</version> + <relativePath>../../pom.xml</relativePath> + </parent> + <name>Solr Webapp (Apache Solr)</name> + <artifactId>${rootArtifactId}-${artifactId}</artifactId> + <packaging>war</packaging> + + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <testSourceDirectory>src/test</testSourceDirectory> + <outputDirectory>target/classes</outputDirectory> + + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + <resource> + <directory>src/main/java</directory> + <includes> + <include>**</include> + </includes> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.1.1</version> + <configuration> + <overlays> + <overlay> + <groupId>org.apache.solr</groupId> + <artifactId>solr</artifactId> + </overlay> + </overlays> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr</artifactId> + <version>4.7.0</version> + <type>war</type> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jul-to-slf4j</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.16</version> + </dependency> + + </dependencies> + +</project> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/META-INF/context.xml URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/META-INF/context.xml?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/META-INF/context.xml (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/META-INF/context.xml Mon Mar 31 23:31:37 2014 @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Context path="/solr"> + <Parameter name="solr/home" value="../solr"/> +</Context> Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/lib/log4j.properties URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/lib/log4j.properties?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/lib/log4j.properties (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/lib/log4j.properties Mon Mar 31 23:31:37 2014 @@ -0,0 +1,24 @@ +# Logging level +solr.log=logs/ +log4j.rootLogger=INFO, file, CONSOLE + +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender + +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x \u2013 %m%n + +#- size rotation with log cleanup. +log4j.appender.file=org.apache.log4j.RollingFileAppender +log4j.appender.file.MaxFileSize=4MB +log4j.appender.file.MaxBackupIndex=9 + +#- File to log to and log format +log4j.appender.file.File=${solr.log}/solr.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m\n + +log4j.logger.org.apache.zookeeper=WARN +log4j.logger.org.apache.hadoop=WARN + +# set to INFO to enable infostream log messages +log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF Added: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/web.xml?rev=1583490&view=auto ============================================================================== --- oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/web.xml (added) +++ oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/web.xml Mon Mar 31 23:31:37 2014 @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<web-app xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" + version="2.5" + metadata-complete="true" +> + + + <!-- Uncomment if you are trying to use a Resin version before 3.0.19. + Their XML implementation isn't entirely compatible with Xerces. + Below are the implementations to use with Sun's JVM. + <system-property javax.xml.xpath.XPathFactory= + "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/> + <system-property javax.xml.parsers.DocumentBuilderFactory= + "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/> + <system-property javax.xml.parsers.SAXParserFactory= + "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/> + --> + + <!-- People who want to hardcode their "Solr Home" directly into the + WAR File can set the JNDI property here... + --> + + <env-entry> + <env-entry-name>solr/home</env-entry-name> + <env-entry-value>../solr</env-entry-value> + <env-entry-type>java.lang.String</env-entry-type> + </env-entry> + + + <!-- Any path (name) registered in solrconfig.xml will be sent to that filter --> + <filter> + <filter-name>SolrRequestFilter</filter-name> + <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class> + <!-- If you are wiring Solr into a larger web application which controls + the web context root, you will probably want to mount Solr under + a path prefix (app.war with /app/solr mounted into it, for example). + You will need to put this prefix in front of the SolrDispatchFilter + url-pattern mapping too (/solr/*), and also on any paths for + legacy Solr servlet mappings you may be using. + For the Admin UI to work properly in a path-prefixed configuration, + the admin folder containing the resources needs to be under the app context root + named to match the path-prefix. For example: + + .war + xxx + js + main.js + --> + <!-- + <init-param> + <param-name>path-prefix</param-name> + <param-value>/xxx</param-value> + </init-param> + --> + </filter> + + <filter-mapping> + <!-- + NOTE: When using multicore, /admin JSP URLs with a core specified + such as /solr/coreName/admin/stats.jsp get forwarded by a + RequestDispatcher to /solr/admin/stats.jsp with the specified core + put into request scope keyed as "org.apache.solr.SolrCore". + + It is unnecessary, and potentially problematic, to have the SolrDispatchFilter + configured to also filter on forwards. Do not configure + this dispatcher as <dispatcher>FORWARD</dispatcher>. + --> + <filter-name>SolrRequestFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <servlet> + <servlet-name>Zookeeper</servlet-name> + <servlet-class>org.apache.solr.servlet.ZookeeperInfoServlet</servlet-class> + </servlet> + + <servlet> + <servlet-name>LoadAdminUI</servlet-name> + <servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class> + </servlet> + + <!-- Remove in Solr 5.0 --> + <!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 --> + <servlet> + <servlet-name>RedirectOldAdminUI</servlet-name> + <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> + <init-param> + <param-name>destination</param-name> + <param-value>${context}/#/</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>RedirectOldZookeeper</servlet-name> + <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> + <init-param> + <param-name>destination</param-name> + <param-value>${context}/zookeeper</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>RedirectLogging</servlet-name> + <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> + <init-param> + <param-name>destination</param-name> + <param-value>${context}/#/~logging</param-value> + </init-param> + </servlet> + + <servlet> + <servlet-name>SolrRestApi</servlet-name> + <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> + <init-param> + <param-name>org.restlet.application</param-name> + <param-value>org.apache.solr.rest.SolrRestApi</param-value> + </init-param> + </servlet> + + <servlet-mapping> + <servlet-name>RedirectOldAdminUI</servlet-name> + <url-pattern>/admin/</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>RedirectOldAdminUI</servlet-name> + <url-pattern>/admin</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>RedirectOldZookeeper</servlet-name> + <url-pattern>/zookeeper.jsp</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>RedirectLogging</servlet-name> + <url-pattern>/logging</url-pattern> + </servlet-mapping> + + <!-- Servlet Mapping --> + <servlet-mapping> + <servlet-name>Zookeeper</servlet-name> + <url-pattern>/zookeeper</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>LoadAdminUI</servlet-name> + <url-pattern>/admin.html</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>SolrRestApi</servlet-name> + <url-pattern>/schema/*</url-pattern> + </servlet-mapping> + + <mime-mapping> + <extension>.xsl</extension> + <!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ --> + <mime-type>application/xslt+xml</mime-type> + </mime-mapping> + + <welcome-file-list> + <welcome-file>admin.html</welcome-file> + </welcome-file-list> + +</web-app> Propchange: oodt/trunk/mvn/archetypes/radix/src/main/resources/archetype-resources/webapps/solr-webapp/src/main/webapp/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:executable = *
