NIHVIVO-2437 Upgrade to Solr 3.1
This commit is contained in:
parent
ad98e7723c
commit
265a86019c
27 changed files with 7060 additions and 2693 deletions
Binary file not shown.
BIN
solr/apache-solr-3.1.0.war
Normal file
BIN
solr/apache-solr-3.1.0.war
Normal file
Binary file not shown.
|
@ -12,7 +12,7 @@
|
||||||
<property name="solr.build.dir" location="."/>
|
<property name="solr.build.dir" location="."/>
|
||||||
<property name="solr.example.dir" location="${solr.build.dir}/exampleSolr" />
|
<property name="solr.example.dir" location="${solr.build.dir}/exampleSolr" />
|
||||||
<property name="solr.context.config.example" location="${solr.build.dir}/exampleSolrContext.xml"/>
|
<property name="solr.context.config.example" location="${solr.build.dir}/exampleSolrContext.xml"/>
|
||||||
<property name="solr.war" location="${solr.build.dir}/apache-solr-1.4.1.war"/>
|
<property name="solr.war" location="${solr.build.dir}/apache-solr-3.1.0.war"/>
|
||||||
|
|
||||||
<!-- =================================
|
<!-- =================================
|
||||||
target: describe
|
target: describe
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
# this work for additional information regarding copyright ownership.
|
# this work for additional information regarding copyright ownership.
|
||||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
# 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 not use this file except in compliance with
|
||||||
# the License. You may obtain a copy of the License at
|
# the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
Example "Solr Home" Directory
|
Example "Solr Home" Directory
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
This directory is provided as an example of what a "Solr Home" directory
|
This directory is provided as an example of what a "Solr Home" directory
|
||||||
should look like.
|
should look like.
|
||||||
|
|
||||||
It's not strictly necessary that you copy all of the files in this
|
It's not strictly necessary that you copy all of the files in this
|
||||||
directory when setting up a new instance of Solr, but it is recommended.
|
directory when setting up a new instance of Solr, but it is recommended.
|
||||||
|
|
||||||
|
|
||||||
Basic Directory Structure
|
Basic Directory Structure
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
The Solr Home directory typically contains the following subdirectories...
|
The Solr Home directory typically contains the following subdirectories...
|
||||||
|
|
||||||
conf/
|
conf/
|
||||||
This directory is mandatory and must contain your solrconfig.xml
|
This directory is mandatory and must contain your solrconfig.xml
|
||||||
and schema.xml. Any other optional configuration files would also
|
and schema.xml. Any other optional configuration files would also
|
||||||
be kept here.
|
be kept here.
|
||||||
|
|
||||||
data/
|
data/
|
||||||
This directory is the default location where Solr will keep your
|
This directory is the default location where Solr will keep your
|
||||||
index, and is used by the replication scripts for dealing with
|
index, and is used by the replication scripts for dealing with
|
||||||
snapshots. You can override this location in the solrconfig.xml
|
snapshots. You can override this location in the solrconfig.xml
|
||||||
and scripts.conf files. Solr will create this directory if it
|
and scripts.conf files. Solr will create this directory if it
|
||||||
does not already exist.
|
does not already exist.
|
||||||
|
|
||||||
lib/
|
lib/
|
||||||
This directory is optional. If it exists, Solr will load any Jars
|
This directory is optional. If it exists, Solr will load any Jars
|
||||||
found in this directory and use them to resolve any "plugins"
|
found in this directory and use them to resolve any "plugins"
|
||||||
specified in your solrconfig.xml or schema.xml (ie: Analyzers,
|
specified in your solrconfig.xml or schema.xml (ie: Analyzers,
|
||||||
Request Handlers, etc...). Alternatively you can use the <lib>
|
Request Handlers, etc...). Alternatively you can use the <lib>
|
||||||
syntax in solrconfig.xml to direct Solr to your plugins. See the
|
syntax in solrconfig.xml to direct Solr to your plugins. See the
|
||||||
example solrconfig.xml file for details.
|
example solrconfig.xml file for details.
|
||||||
|
|
||||||
bin/
|
bin/
|
||||||
This directory is optional. It is the default location used for
|
This directory is optional. It is the default location used for
|
||||||
keeping the replication scripts.
|
keeping the replication scripts.
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
this work for additional information regarding copyright ownership.
|
this work for additional information regarding copyright ownership.
|
||||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
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 not use this file except in compliance with
|
||||||
the License. You may obtain a copy of the License at
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- The content of this page will be statically included into the top
|
<!-- The content of this page will be statically included into the top
|
||||||
of the admin page. Uncomment this as an example to see there the content
|
of the admin page. Uncomment this as an example to see there the content
|
||||||
will show up.
|
will show up.
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<i>This line will appear before the first table</i>
|
<i>This line will appear before the first table</i>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
This row will be appended to the end of the first table
|
This row will be appended to the end of the first table
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
this work for additional information regarding copyright ownership.
|
this work for additional information regarding copyright ownership.
|
||||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
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 not use this file except in compliance with
|
||||||
the License. You may obtain a copy of the License at
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- If this file is found in the config directory, it will only be
|
<!-- If this file is found in the config directory, it will only be
|
||||||
loaded once at startup. If it is found in Solr's data
|
loaded once at startup. If it is found in Solr's data
|
||||||
directory, it will be re-loaded every commit.
|
directory, it will be re-loaded every commit.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<elevate>
|
<elevate>
|
||||||
<query text="foo bar">
|
<query text="foo bar">
|
||||||
<doc id="1" />
|
<doc id="1" />
|
||||||
<doc id="2" />
|
<doc id="2" />
|
||||||
<doc id="3" />
|
<doc id="3" />
|
||||||
</query>
|
</query>
|
||||||
|
|
||||||
<query text="ipod">
|
<query text="ipod">
|
||||||
<doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
|
<doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
|
||||||
<doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
|
<doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
|
||||||
</query>
|
</query>
|
||||||
|
|
||||||
</elevate>
|
</elevate>
|
||||||
|
|
3813
solr/exampleSolr/conf/mapping-FoldToASCII.txt
Normal file
3813
solr/exampleSolr/conf/mapping-FoldToASCII.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,246 +1,246 @@
|
||||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
# 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 not use this file except in compliance with
|
||||||
# the License. You may obtain a copy of the License at
|
# the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# Syntax:
|
# Syntax:
|
||||||
# "source" => "target"
|
# "source" => "target"
|
||||||
# "source".length() > 0 (source cannot be empty.)
|
# "source".length() > 0 (source cannot be empty.)
|
||||||
# "target".length() >= 0 (target can be empty.)
|
# "target".length() >= 0 (target can be empty.)
|
||||||
|
|
||||||
# example:
|
# example:
|
||||||
# "À" => "A"
|
# "À" => "A"
|
||||||
# "\u00C0" => "A"
|
# "\u00C0" => "A"
|
||||||
# "\u00C0" => "\u0041"
|
# "\u00C0" => "\u0041"
|
||||||
# "ß" => "ss"
|
# "ß" => "ss"
|
||||||
# "\t" => " "
|
# "\t" => " "
|
||||||
# "\n" => ""
|
# "\n" => ""
|
||||||
|
|
||||||
# À => A
|
# À => A
|
||||||
"\u00C0" => "A"
|
"\u00C0" => "A"
|
||||||
|
|
||||||
# Á => A
|
# Á => A
|
||||||
"\u00C1" => "A"
|
"\u00C1" => "A"
|
||||||
|
|
||||||
# Â => A
|
# Â => A
|
||||||
"\u00C2" => "A"
|
"\u00C2" => "A"
|
||||||
|
|
||||||
# Ã => A
|
# Ã => A
|
||||||
"\u00C3" => "A"
|
"\u00C3" => "A"
|
||||||
|
|
||||||
# Ä => A
|
# Ä => A
|
||||||
"\u00C4" => "A"
|
"\u00C4" => "A"
|
||||||
|
|
||||||
# Å => A
|
# Å => A
|
||||||
"\u00C5" => "A"
|
"\u00C5" => "A"
|
||||||
|
|
||||||
# Æ => AE
|
# Æ => AE
|
||||||
"\u00C6" => "AE"
|
"\u00C6" => "AE"
|
||||||
|
|
||||||
# Ç => C
|
# Ç => C
|
||||||
"\u00C7" => "C"
|
"\u00C7" => "C"
|
||||||
|
|
||||||
# È => E
|
# È => E
|
||||||
"\u00C8" => "E"
|
"\u00C8" => "E"
|
||||||
|
|
||||||
# É => E
|
# É => E
|
||||||
"\u00C9" => "E"
|
"\u00C9" => "E"
|
||||||
|
|
||||||
# Ê => E
|
# Ê => E
|
||||||
"\u00CA" => "E"
|
"\u00CA" => "E"
|
||||||
|
|
||||||
# Ë => E
|
# Ë => E
|
||||||
"\u00CB" => "E"
|
"\u00CB" => "E"
|
||||||
|
|
||||||
# Ì => I
|
# Ì => I
|
||||||
"\u00CC" => "I"
|
"\u00CC" => "I"
|
||||||
|
|
||||||
# Í => I
|
# Í => I
|
||||||
"\u00CD" => "I"
|
"\u00CD" => "I"
|
||||||
|
|
||||||
# Î => I
|
# Î => I
|
||||||
"\u00CE" => "I"
|
"\u00CE" => "I"
|
||||||
|
|
||||||
# Ï => I
|
# Ï => I
|
||||||
"\u00CF" => "I"
|
"\u00CF" => "I"
|
||||||
|
|
||||||
# IJ => IJ
|
# IJ => IJ
|
||||||
"\u0132" => "IJ"
|
"\u0132" => "IJ"
|
||||||
|
|
||||||
# Ð => D
|
# Ð => D
|
||||||
"\u00D0" => "D"
|
"\u00D0" => "D"
|
||||||
|
|
||||||
# Ñ => N
|
# Ñ => N
|
||||||
"\u00D1" => "N"
|
"\u00D1" => "N"
|
||||||
|
|
||||||
# Ò => O
|
# Ò => O
|
||||||
"\u00D2" => "O"
|
"\u00D2" => "O"
|
||||||
|
|
||||||
# Ó => O
|
# Ó => O
|
||||||
"\u00D3" => "O"
|
"\u00D3" => "O"
|
||||||
|
|
||||||
# Ô => O
|
# Ô => O
|
||||||
"\u00D4" => "O"
|
"\u00D4" => "O"
|
||||||
|
|
||||||
# Õ => O
|
# Õ => O
|
||||||
"\u00D5" => "O"
|
"\u00D5" => "O"
|
||||||
|
|
||||||
# Ö => O
|
# Ö => O
|
||||||
"\u00D6" => "O"
|
"\u00D6" => "O"
|
||||||
|
|
||||||
# Ø => O
|
# Ø => O
|
||||||
"\u00D8" => "O"
|
"\u00D8" => "O"
|
||||||
|
|
||||||
# Œ => OE
|
# Œ => OE
|
||||||
"\u0152" => "OE"
|
"\u0152" => "OE"
|
||||||
|
|
||||||
# Þ
|
# Þ
|
||||||
"\u00DE" => "TH"
|
"\u00DE" => "TH"
|
||||||
|
|
||||||
# Ù => U
|
# Ù => U
|
||||||
"\u00D9" => "U"
|
"\u00D9" => "U"
|
||||||
|
|
||||||
# Ú => U
|
# Ú => U
|
||||||
"\u00DA" => "U"
|
"\u00DA" => "U"
|
||||||
|
|
||||||
# Û => U
|
# Û => U
|
||||||
"\u00DB" => "U"
|
"\u00DB" => "U"
|
||||||
|
|
||||||
# Ü => U
|
# Ü => U
|
||||||
"\u00DC" => "U"
|
"\u00DC" => "U"
|
||||||
|
|
||||||
# Ý => Y
|
# Ý => Y
|
||||||
"\u00DD" => "Y"
|
"\u00DD" => "Y"
|
||||||
|
|
||||||
# Ÿ => Y
|
# Ÿ => Y
|
||||||
"\u0178" => "Y"
|
"\u0178" => "Y"
|
||||||
|
|
||||||
# à => a
|
# à => a
|
||||||
"\u00E0" => "a"
|
"\u00E0" => "a"
|
||||||
|
|
||||||
# á => a
|
# á => a
|
||||||
"\u00E1" => "a"
|
"\u00E1" => "a"
|
||||||
|
|
||||||
# â => a
|
# â => a
|
||||||
"\u00E2" => "a"
|
"\u00E2" => "a"
|
||||||
|
|
||||||
# ã => a
|
# ã => a
|
||||||
"\u00E3" => "a"
|
"\u00E3" => "a"
|
||||||
|
|
||||||
# ä => a
|
# ä => a
|
||||||
"\u00E4" => "a"
|
"\u00E4" => "a"
|
||||||
|
|
||||||
# å => a
|
# å => a
|
||||||
"\u00E5" => "a"
|
"\u00E5" => "a"
|
||||||
|
|
||||||
# æ => ae
|
# æ => ae
|
||||||
"\u00E6" => "ae"
|
"\u00E6" => "ae"
|
||||||
|
|
||||||
# ç => c
|
# ç => c
|
||||||
"\u00E7" => "c"
|
"\u00E7" => "c"
|
||||||
|
|
||||||
# è => e
|
# è => e
|
||||||
"\u00E8" => "e"
|
"\u00E8" => "e"
|
||||||
|
|
||||||
# é => e
|
# é => e
|
||||||
"\u00E9" => "e"
|
"\u00E9" => "e"
|
||||||
|
|
||||||
# ê => e
|
# ê => e
|
||||||
"\u00EA" => "e"
|
"\u00EA" => "e"
|
||||||
|
|
||||||
# ë => e
|
# ë => e
|
||||||
"\u00EB" => "e"
|
"\u00EB" => "e"
|
||||||
|
|
||||||
# ì => i
|
# ì => i
|
||||||
"\u00EC" => "i"
|
"\u00EC" => "i"
|
||||||
|
|
||||||
# í => i
|
# í => i
|
||||||
"\u00ED" => "i"
|
"\u00ED" => "i"
|
||||||
|
|
||||||
# î => i
|
# î => i
|
||||||
"\u00EE" => "i"
|
"\u00EE" => "i"
|
||||||
|
|
||||||
# ï => i
|
# ï => i
|
||||||
"\u00EF" => "i"
|
"\u00EF" => "i"
|
||||||
|
|
||||||
# ij => ij
|
# ij => ij
|
||||||
"\u0133" => "ij"
|
"\u0133" => "ij"
|
||||||
|
|
||||||
# ð => d
|
# ð => d
|
||||||
"\u00F0" => "d"
|
"\u00F0" => "d"
|
||||||
|
|
||||||
# ñ => n
|
# ñ => n
|
||||||
"\u00F1" => "n"
|
"\u00F1" => "n"
|
||||||
|
|
||||||
# ò => o
|
# ò => o
|
||||||
"\u00F2" => "o"
|
"\u00F2" => "o"
|
||||||
|
|
||||||
# ó => o
|
# ó => o
|
||||||
"\u00F3" => "o"
|
"\u00F3" => "o"
|
||||||
|
|
||||||
# ô => o
|
# ô => o
|
||||||
"\u00F4" => "o"
|
"\u00F4" => "o"
|
||||||
|
|
||||||
# õ => o
|
# õ => o
|
||||||
"\u00F5" => "o"
|
"\u00F5" => "o"
|
||||||
|
|
||||||
# ö => o
|
# ö => o
|
||||||
"\u00F6" => "o"
|
"\u00F6" => "o"
|
||||||
|
|
||||||
# ø => o
|
# ø => o
|
||||||
"\u00F8" => "o"
|
"\u00F8" => "o"
|
||||||
|
|
||||||
# œ => oe
|
# œ => oe
|
||||||
"\u0153" => "oe"
|
"\u0153" => "oe"
|
||||||
|
|
||||||
# ß => ss
|
# ß => ss
|
||||||
"\u00DF" => "ss"
|
"\u00DF" => "ss"
|
||||||
|
|
||||||
# þ => th
|
# þ => th
|
||||||
"\u00FE" => "th"
|
"\u00FE" => "th"
|
||||||
|
|
||||||
# ù => u
|
# ù => u
|
||||||
"\u00F9" => "u"
|
"\u00F9" => "u"
|
||||||
|
|
||||||
# ú => u
|
# ú => u
|
||||||
"\u00FA" => "u"
|
"\u00FA" => "u"
|
||||||
|
|
||||||
# û => u
|
# û => u
|
||||||
"\u00FB" => "u"
|
"\u00FB" => "u"
|
||||||
|
|
||||||
# ü => u
|
# ü => u
|
||||||
"\u00FC" => "u"
|
"\u00FC" => "u"
|
||||||
|
|
||||||
# ý => y
|
# ý => y
|
||||||
"\u00FD" => "y"
|
"\u00FD" => "y"
|
||||||
|
|
||||||
# ÿ => y
|
# ÿ => y
|
||||||
"\u00FF" => "y"
|
"\u00FF" => "y"
|
||||||
|
|
||||||
# ff => ff
|
# ff => ff
|
||||||
"\uFB00" => "ff"
|
"\uFB00" => "ff"
|
||||||
|
|
||||||
# fi => fi
|
# fi => fi
|
||||||
"\uFB01" => "fi"
|
"\uFB01" => "fi"
|
||||||
|
|
||||||
# fl => fl
|
# fl => fl
|
||||||
"\uFB02" => "fl"
|
"\uFB02" => "fl"
|
||||||
|
|
||||||
# ffi => ffi
|
# ffi => ffi
|
||||||
"\uFB03" => "ffi"
|
"\uFB03" => "ffi"
|
||||||
|
|
||||||
# ffl => ffl
|
# ffl => ffl
|
||||||
"\uFB04" => "ffl"
|
"\uFB04" => "ffl"
|
||||||
|
|
||||||
# ſt => ft
|
# ſt => ft
|
||||||
"\uFB05" => "ft"
|
"\uFB05" => "ft"
|
||||||
|
|
||||||
# st => st
|
# st => st
|
||||||
"\uFB06" => "st"
|
"\uFB06" => "st"
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
# 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 not use this file except in compliance with
|
||||||
# the License. You may obtain a copy of the License at
|
# the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# Use a protected word file to protect against the stemmer reducing two
|
# Use a protected word file to protect against the stemmer reducing two
|
||||||
# unrelated words to the same base word.
|
# unrelated words to the same base word.
|
||||||
|
|
||||||
# Some non-words that normally won't be encountered,
|
# Some non-words that normally won't be encountered,
|
||||||
# just to test that they won't be stemmed.
|
# just to test that they won't be stemmed.
|
||||||
dontstems
|
dontstems
|
||||||
zwhacky
|
zwhacky
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,2 +1,2 @@
|
||||||
pizza
|
pizza
|
||||||
history
|
history
|
||||||
|
|
|
@ -1,58 +1,58 @@
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
# this work for additional information regarding copyright ownership.
|
# this work for additional information regarding copyright ownership.
|
||||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
# 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 not use this file except in compliance with
|
||||||
# the License. You may obtain a copy of the License at
|
# the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# a couple of test stopwords to test that the words are really being
|
# a couple of test stopwords to test that the words are really being
|
||||||
# configured from this file:
|
# configured from this file:
|
||||||
stopworda
|
stopworda
|
||||||
stopwordb
|
stopwordb
|
||||||
|
|
||||||
#Standard english stop words taken from Lucene's StopAnalyzer
|
#Standard english stop words taken from Lucene's StopAnalyzer
|
||||||
a
|
a
|
||||||
an
|
an
|
||||||
and
|
and
|
||||||
are
|
are
|
||||||
as
|
as
|
||||||
at
|
at
|
||||||
be
|
be
|
||||||
but
|
but
|
||||||
by
|
by
|
||||||
for
|
for
|
||||||
if
|
if
|
||||||
in
|
in
|
||||||
into
|
into
|
||||||
is
|
is
|
||||||
it
|
it
|
||||||
no
|
no
|
||||||
not
|
not
|
||||||
of
|
of
|
||||||
on
|
on
|
||||||
or
|
or
|
||||||
s
|
s
|
||||||
such
|
such
|
||||||
t
|
t
|
||||||
that
|
that
|
||||||
the
|
the
|
||||||
their
|
their
|
||||||
then
|
then
|
||||||
there
|
there
|
||||||
these
|
these
|
||||||
they
|
they
|
||||||
this
|
this
|
||||||
to
|
to
|
||||||
was
|
was
|
||||||
will
|
will
|
||||||
with
|
with
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,29 @@
|
||||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
# 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 not use this file except in compliance with
|
||||||
# the License. You may obtain a copy of the License at
|
# the License. You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
#some test synonym mappings unlikely to appear in real input text
|
#some test synonym mappings unlikely to appear in real input text
|
||||||
aaa => aaaa
|
aaafoo => aaabar
|
||||||
bbb => bbbb1 bbbb2
|
bbbfoo => bbbfoo bbbbar
|
||||||
ccc => cccc1,cccc2
|
cccfoo => cccbar cccbaz
|
||||||
a\=>a => b\=>b
|
fooaaa,baraaa,bazaaa
|
||||||
a\,a => b\,b
|
|
||||||
fooaaa,baraaa,bazaaa
|
# Some synonym groups specific to this example
|
||||||
|
GB,gib,gigabyte,gigabytes
|
||||||
# Some synonym groups specific to this example
|
MB,mib,megabyte,megabytes
|
||||||
GB,gib,gigabyte,gigabytes
|
Television, Televisions, TV, TVs
|
||||||
MB,mib,megabyte,megabytes
|
#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
|
||||||
Television, Televisions, TV, TVs
|
#after us won't split it into two words.
|
||||||
#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
|
|
||||||
#after us won't split it into two words.
|
# Synonym mappings can be used for spelling correction too
|
||||||
|
pixima => pixma
|
||||||
# Synonym mappings can be used for spelling correction too
|
|
||||||
pixima => pixma
|
|
||||||
|
|
||||||
|
|
|
@ -1,132 +1,132 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
* this work for additional information regarding copyright ownership.
|
* this work for additional information regarding copyright ownership.
|
||||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
* 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 not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Simple transform of Solr query results to HTML
|
Simple transform of Solr query results to HTML
|
||||||
-->
|
-->
|
||||||
<xsl:stylesheet version='1.0'
|
<xsl:stylesheet version='1.0'
|
||||||
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
|
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
|
||||||
>
|
>
|
||||||
|
|
||||||
<xsl:output media-type="text/html; charset=UTF-8" encoding="UTF-8"/>
|
<xsl:output media-type="text/html" encoding="UTF-8"/>
|
||||||
|
|
||||||
<xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
|
<xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
|
||||||
|
|
||||||
<xsl:template match='/'>
|
<xsl:template match='/'>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><xsl:value-of select="$title"/></title>
|
<title><xsl:value-of select="$title"/></title>
|
||||||
<xsl:call-template name="css"/>
|
<xsl:call-template name="css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1><xsl:value-of select="$title"/></h1>
|
<h1><xsl:value-of select="$title"/></h1>
|
||||||
<div class="note">
|
<div class="note">
|
||||||
This has been formatted by the sample "example.xsl" transform -
|
This has been formatted by the sample "example.xsl" transform -
|
||||||
use your own XSLT to get a nicer page
|
use your own XSLT to get a nicer page
|
||||||
</div>
|
</div>
|
||||||
<xsl:apply-templates select="response/result/doc"/>
|
<xsl:apply-templates select="response/result/doc"/>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="doc">
|
<xsl:template match="doc">
|
||||||
<xsl:variable name="pos" select="position()"/>
|
<xsl:variable name="pos" select="position()"/>
|
||||||
<div class="doc">
|
<div class="doc">
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<xsl:apply-templates>
|
<xsl:apply-templates>
|
||||||
<xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param>
|
<xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="doc/*[@name='score']" priority="100">
|
<xsl:template match="doc/*[@name='score']" priority="100">
|
||||||
<xsl:param name="pos"></xsl:param>
|
<xsl:param name="pos"></xsl:param>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
|
|
||||||
<xsl:if test="boolean(//lst[@name='explain'])">
|
<xsl:if test="boolean(//lst[@name='explain'])">
|
||||||
<xsl:element name="a">
|
<xsl:element name="a">
|
||||||
<!-- can't allow whitespace here -->
|
<!-- can't allow whitespace here -->
|
||||||
<xsl:attribute name="href">javascript:toggle("<xsl:value-of select="concat('exp-',$pos)" />");</xsl:attribute>?</xsl:element>
|
<xsl:attribute name="href">javascript:toggle("<xsl:value-of select="concat('exp-',$pos)" />");</xsl:attribute>?</xsl:element>
|
||||||
<br/>
|
<br/>
|
||||||
<xsl:element name="div">
|
<xsl:element name="div">
|
||||||
<xsl:attribute name="class">exp</xsl:attribute>
|
<xsl:attribute name="class">exp</xsl:attribute>
|
||||||
<xsl:attribute name="id">
|
<xsl:attribute name="id">
|
||||||
<xsl:value-of select="concat('exp-',$pos)" />
|
<xsl:value-of select="concat('exp-',$pos)" />
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:value-of select="//lst[@name='explain']/str[position()=$pos]"/>
|
<xsl:value-of select="//lst[@name='explain']/str[position()=$pos]"/>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="doc/arr" priority="100">
|
<xsl:template match="doc/arr" priority="100">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<ul>
|
<ul>
|
||||||
<xsl:for-each select="*">
|
<xsl:for-each select="*">
|
||||||
<li><xsl:value-of select="."/></li>
|
<li><xsl:value-of select="."/></li>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
<xsl:template match="doc/*">
|
<xsl:template match="doc/*">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="*"/>
|
<xsl:template match="*"/>
|
||||||
|
|
||||||
<xsl:template name="css">
|
<xsl:template name="css">
|
||||||
<script>
|
<script>
|
||||||
function toggle(id) {
|
function toggle(id) {
|
||||||
var obj = document.getElementById(id);
|
var obj = document.getElementById(id);
|
||||||
obj.style.display = (obj.style.display != 'block') ? 'block' : 'none';
|
obj.style.display = (obj.style.display != 'block') ? 'block' : 'none';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body { font-family: "Lucida Grande", sans-serif }
|
body { font-family: "Lucida Grande", sans-serif }
|
||||||
td.name { font-style: italic; font-size:80%; }
|
td.name { font-style: italic; font-size:80%; }
|
||||||
td { vertical-align: top; }
|
td { vertical-align: top; }
|
||||||
ul { margin: 0px; margin-left: 1em; padding: 0px; }
|
ul { margin: 0px; margin-left: 1em; padding: 0px; }
|
||||||
.note { font-size:80%; }
|
.note { font-size:80%; }
|
||||||
.doc { margin-top: 1em; border-top: solid grey 1px; }
|
.doc { margin-top: 1em; border-top: solid grey 1px; }
|
||||||
.exp { display: none; font-family: monospace; white-space: pre; }
|
.exp { display: none; font-family: monospace; white-space: pre; }
|
||||||
</style>
|
</style>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -1,67 +1,67 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
* this work for additional information regarding copyright ownership.
|
* this work for additional information regarding copyright ownership.
|
||||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
* 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 not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Simple transform of Solr query results to Atom
|
Simple transform of Solr query results to Atom
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<xsl:stylesheet version='1.0'
|
<xsl:stylesheet version='1.0'
|
||||||
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
|
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
|
||||||
|
|
||||||
<xsl:output
|
<xsl:output
|
||||||
method="xml"
|
method="xml"
|
||||||
encoding="utf-8"
|
encoding="utf-8"
|
||||||
media-type="text/xml; charset=UTF-8"
|
media-type="application/xml"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<xsl:template match='/'>
|
<xsl:template match='/'>
|
||||||
<xsl:variable name="query" select="response/lst[@name='responseHeader']/lst[@name='params']/str[@name='q']"/>
|
<xsl:variable name="query" select="response/lst[@name='responseHeader']/lst[@name='params']/str[@name='q']"/>
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
<title>Example Solr Atom 1.0 Feed</title>
|
<title>Example Solr Atom 1.0 Feed</title>
|
||||||
<subtitle>
|
<subtitle>
|
||||||
This has been formatted by the sample "example_atom.xsl" transform -
|
This has been formatted by the sample "example_atom.xsl" transform -
|
||||||
use your own XSLT to get a nicer Atom feed.
|
use your own XSLT to get a nicer Atom feed.
|
||||||
</subtitle>
|
</subtitle>
|
||||||
<author>
|
<author>
|
||||||
<name>Apache Solr</name>
|
<name>Apache Solr</name>
|
||||||
<email>solr-user@lucene.apache.org</email>
|
<email>solr-user@lucene.apache.org</email>
|
||||||
</author>
|
</author>
|
||||||
<link rel="self" type="application/atom+xml"
|
<link rel="self" type="application/atom+xml"
|
||||||
href="http://localhost:8983/solr/q={$query}&wt=xslt&tr=atom.xsl"/>
|
href="http://localhost:8983/solr/q={$query}&wt=xslt&tr=atom.xsl"/>
|
||||||
<updated>
|
<updated>
|
||||||
<xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
|
<xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
|
||||||
</updated>
|
</updated>
|
||||||
<id>tag:localhost,2007:example</id>
|
<id>tag:localhost,2007:example</id>
|
||||||
<xsl:apply-templates select="response/result/doc"/>
|
<xsl:apply-templates select="response/result/doc"/>
|
||||||
</feed>
|
</feed>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- search results xslt -->
|
<!-- search results xslt -->
|
||||||
<xsl:template match="doc">
|
<xsl:template match="doc">
|
||||||
<xsl:variable name="id" select="str[@name='id']"/>
|
<xsl:variable name="id" select="str[@name='id']"/>
|
||||||
<entry>
|
<entry>
|
||||||
<title><xsl:value-of select="str[@name='name']"/></title>
|
<title><xsl:value-of select="str[@name='name']"/></title>
|
||||||
<link href="http://localhost:8983/solr/select?q={$id}"/>
|
<link href="http://localhost:8983/solr/select?q={$id}"/>
|
||||||
<id>tag:localhost,2007:<xsl:value-of select="$id"/></id>
|
<id>tag:localhost,2007:<xsl:value-of select="$id"/></id>
|
||||||
<summary><xsl:value-of select="arr[@name='features']"/></summary>
|
<summary><xsl:value-of select="arr[@name='features']"/></summary>
|
||||||
<updated><xsl:value-of select="date[@name='timestamp']"/></updated>
|
<updated><xsl:value-of select="date[@name='timestamp']"/></updated>
|
||||||
</entry>
|
</entry>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -1,66 +1,66 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
* this work for additional information regarding copyright ownership.
|
* this work for additional information regarding copyright ownership.
|
||||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
* 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 not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Simple transform of Solr query results to RSS
|
Simple transform of Solr query results to RSS
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<xsl:stylesheet version='1.0'
|
<xsl:stylesheet version='1.0'
|
||||||
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
|
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
|
||||||
|
|
||||||
<xsl:output
|
<xsl:output
|
||||||
method="xml"
|
method="xml"
|
||||||
encoding="utf-8"
|
encoding="utf-8"
|
||||||
media-type="text/xml; charset=UTF-8"
|
media-type="application/xml"
|
||||||
/>
|
/>
|
||||||
<xsl:template match='/'>
|
<xsl:template match='/'>
|
||||||
<rss version="2.0">
|
<rss version="2.0">
|
||||||
<channel>
|
<channel>
|
||||||
<title>Example Solr RSS 2.0 Feed</title>
|
<title>Example Solr RSS 2.0 Feed</title>
|
||||||
<link>http://localhost:8983/solr</link>
|
<link>http://localhost:8983/solr</link>
|
||||||
<description>
|
<description>
|
||||||
This has been formatted by the sample "example_rss.xsl" transform -
|
This has been formatted by the sample "example_rss.xsl" transform -
|
||||||
use your own XSLT to get a nicer RSS feed.
|
use your own XSLT to get a nicer RSS feed.
|
||||||
</description>
|
</description>
|
||||||
<language>en-us</language>
|
<language>en-us</language>
|
||||||
<docs>http://localhost:8983/solr</docs>
|
<docs>http://localhost:8983/solr</docs>
|
||||||
<xsl:apply-templates select="response/result/doc"/>
|
<xsl:apply-templates select="response/result/doc"/>
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- search results xslt -->
|
<!-- search results xslt -->
|
||||||
<xsl:template match="doc">
|
<xsl:template match="doc">
|
||||||
<xsl:variable name="id" select="str[@name='id']"/>
|
<xsl:variable name="id" select="str[@name='id']"/>
|
||||||
<xsl:variable name="timestamp" select="date[@name='timestamp']"/>
|
<xsl:variable name="timestamp" select="date[@name='timestamp']"/>
|
||||||
<item>
|
<item>
|
||||||
<title><xsl:value-of select="str[@name='name']"/></title>
|
<title><xsl:value-of select="str[@name='name']"/></title>
|
||||||
<link>
|
<link>
|
||||||
http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/>
|
http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/>
|
||||||
</link>
|
</link>
|
||||||
<description>
|
<description>
|
||||||
<xsl:value-of select="arr[@name='features']"/>
|
<xsl:value-of select="arr[@name='features']"/>
|
||||||
</description>
|
</description>
|
||||||
<pubDate><xsl:value-of select="$timestamp"/></pubDate>
|
<pubDate><xsl:value-of select="$timestamp"/></pubDate>
|
||||||
<guid>
|
<guid>
|
||||||
http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/>
|
http://localhost:8983/solr/select?q=id:<xsl:value-of select="$id"/>
|
||||||
</guid>
|
</guid>
|
||||||
</item>
|
</item>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -1,337 +1,337 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
this work for additional information regarding copyright ownership.
|
this work for additional information regarding copyright ownership.
|
||||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
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 not use this file except in compliance with
|
||||||
the License. You may obtain a copy of the License at
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Display the luke request handler with graphs
|
Display the luke request handler with graphs
|
||||||
-->
|
-->
|
||||||
<xsl:stylesheet
|
<xsl:stylesheet
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns="http://www.w3.org/1999/xhtml"
|
xmlns="http://www.w3.org/1999/xhtml"
|
||||||
version="1.0"
|
version="1.0"
|
||||||
>
|
>
|
||||||
<xsl:output
|
<xsl:output
|
||||||
method="html"
|
method="html"
|
||||||
encoding="UTF-8"
|
encoding="UTF-8"
|
||||||
media-type="text/html; charset=UTF-8"
|
media-type="text/html"
|
||||||
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<xsl:variable name="title">Solr Luke Request Handler Response</xsl:variable>
|
<xsl:variable name="title">Solr Luke Request Handler Response</xsl:variable>
|
||||||
|
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="solr-admin.css"/>
|
<link rel="stylesheet" type="text/css" href="solr-admin.css"/>
|
||||||
<link rel="icon" href="favicon.ico" type="image/ico"/>
|
<link rel="icon" href="favicon.ico" type="image/ico"/>
|
||||||
<link rel="shortcut icon" href="favicon.ico" type="image/ico"/>
|
<link rel="shortcut icon" href="favicon.ico" type="image/ico"/>
|
||||||
<title>
|
<title>
|
||||||
<xsl:value-of select="$title"/>
|
<xsl:value-of select="$title"/>
|
||||||
</title>
|
</title>
|
||||||
<xsl:call-template name="css"/>
|
<xsl:call-template name="css"/>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>
|
<h1>
|
||||||
<xsl:value-of select="$title"/>
|
<xsl:value-of select="$title"/>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="doc">
|
<div class="doc">
|
||||||
<ul>
|
<ul>
|
||||||
<xsl:if test="response/lst[@name='index']">
|
<xsl:if test="response/lst[@name='index']">
|
||||||
<li>
|
<li>
|
||||||
<a href="#index">Index Statistics</a>
|
<a href="#index">Index Statistics</a>
|
||||||
</li>
|
</li>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="response/lst[@name='fields']">
|
<xsl:if test="response/lst[@name='fields']">
|
||||||
<li>
|
<li>
|
||||||
<a href="#fields">Field Statistics</a>
|
<a href="#fields">Field Statistics</a>
|
||||||
<ul>
|
<ul>
|
||||||
<xsl:for-each select="response/lst[@name='fields']/lst">
|
<xsl:for-each select="response/lst[@name='fields']/lst">
|
||||||
<li>
|
<li>
|
||||||
<a href="#{@name}">
|
<a href="#{@name}">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="response/lst[@name='doc']">
|
<xsl:if test="response/lst[@name='doc']">
|
||||||
<li>
|
<li>
|
||||||
<a href="#doc">Document statistics</a>
|
<a href="#doc">Document statistics</a>
|
||||||
</li>
|
</li>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<xsl:if test="response/lst[@name='index']">
|
<xsl:if test="response/lst[@name='index']">
|
||||||
<h2><a name="index"/>Index Statistics</h2>
|
<h2><a name="index"/>Index Statistics</h2>
|
||||||
<xsl:apply-templates select="response/lst[@name='index']"/>
|
<xsl:apply-templates select="response/lst[@name='index']"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="response/lst[@name='fields']">
|
<xsl:if test="response/lst[@name='fields']">
|
||||||
<h2><a name="fields"/>Field Statistics</h2>
|
<h2><a name="fields"/>Field Statistics</h2>
|
||||||
<xsl:apply-templates select="response/lst[@name='fields']"/>
|
<xsl:apply-templates select="response/lst[@name='fields']"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="response/lst[@name='doc']">
|
<xsl:if test="response/lst[@name='doc']">
|
||||||
<h2><a name="doc"/>Document statistics</h2>
|
<h2><a name="doc"/>Document statistics</h2>
|
||||||
<xsl:apply-templates select="response/lst[@name='doc']"/>
|
<xsl:apply-templates select="response/lst[@name='doc']"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="lst">
|
<xsl:template match="lst">
|
||||||
<xsl:if test="parent::lst">
|
<xsl:if test="parent::lst">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<div class="doc">
|
<div class="doc">
|
||||||
<xsl:call-template name="list"/>
|
<xsl:call-template name="list"/>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="not(parent::lst)">
|
<xsl:if test="not(parent::lst)">
|
||||||
<div class="doc">
|
<div class="doc">
|
||||||
<xsl:call-template name="list"/>
|
<xsl:call-template name="list"/>
|
||||||
</div>
|
</div>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="list">
|
<xsl:template name="list">
|
||||||
<xsl:if test="count(child::*)>0">
|
<xsl:if test="count(child::*)>0">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">
|
<th colspan="2">
|
||||||
<p>
|
<p>
|
||||||
<a name="{@name}"/>
|
<a name="{@name}"/>
|
||||||
</p>
|
</p>
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when
|
<xsl:when
|
||||||
test="@name='histogram'">
|
test="@name='histogram'">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<xsl:call-template name="histogram"/>
|
<xsl:call-template name="histogram"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:apply-templates/>
|
<xsl:apply-templates/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="histogram">
|
<xsl:template name="histogram">
|
||||||
<div class="doc">
|
<div class="doc">
|
||||||
<xsl:call-template name="barchart">
|
<xsl:call-template name="barchart">
|
||||||
<xsl:with-param name="max_bar_width">50</xsl:with-param>
|
<xsl:with-param name="max_bar_width">50</xsl:with-param>
|
||||||
<xsl:with-param name="iwidth">800</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="iheight">160</xsl:with-param>
|
||||||
<xsl:with-param name="fill">blue</xsl:with-param>
|
<xsl:with-param name="fill">blue</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="barchart">
|
<xsl:template name="barchart">
|
||||||
<xsl:param name="max_bar_width"/>
|
<xsl:param name="max_bar_width"/>
|
||||||
<xsl:param name="iwidth"/>
|
<xsl:param name="iwidth"/>
|
||||||
<xsl:param name="iheight"/>
|
<xsl:param name="iheight"/>
|
||||||
<xsl:param name="fill"/>
|
<xsl:param name="fill"/>
|
||||||
<xsl:variable name="max">
|
<xsl:variable name="max">
|
||||||
<xsl:for-each select="int">
|
<xsl:for-each select="int">
|
||||||
<xsl:sort data-type="number" order="descending"/>
|
<xsl:sort data-type="number" order="descending"/>
|
||||||
<xsl:if test="position()=1">
|
<xsl:if test="position()=1">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="bars">
|
<xsl:variable name="bars">
|
||||||
<xsl:value-of select="count(int)"/>
|
<xsl:value-of select="count(int)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="bar_width">
|
<xsl:variable name="bar_width">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$max_bar_width < ($iwidth div $bars)">
|
<xsl:when test="$max_bar_width < ($iwidth div $bars)">
|
||||||
<xsl:value-of select="$max_bar_width"/>
|
<xsl:value-of select="$max_bar_width"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$iwidth div $bars"/>
|
<xsl:value-of select="$iwidth div $bars"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<table class="histogram">
|
<table class="histogram">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<xsl:for-each select="int">
|
<xsl:for-each select="int">
|
||||||
<td>
|
<td>
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
<div class="histogram">
|
<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>
|
<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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<xsl:for-each select="int">
|
<xsl:for-each select="int">
|
||||||
<td>
|
<td>
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="keyvalue">
|
<xsl:template name="keyvalue">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@name">
|
<xsl:when test="@name">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="int|bool|long|float|double|uuid|date">
|
<xsl:template match="int|bool|long|float|double|uuid|date">
|
||||||
<xsl:call-template name="keyvalue"/>
|
<xsl:call-template name="keyvalue"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="arr">
|
<xsl:template match="arr">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<ul>
|
<ul>
|
||||||
<xsl:for-each select="child::*">
|
<xsl:for-each select="child::*">
|
||||||
<li>
|
<li>
|
||||||
<xsl:apply-templates/>
|
<xsl:apply-templates/>
|
||||||
</li>
|
</li>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="str">
|
<xsl:template match="str">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@name='schema' or @name='index' or @name='flags'">
|
<xsl:when test="@name='schema' or @name='index' or @name='flags'">
|
||||||
<xsl:call-template name="schema"/>
|
<xsl:call-template name="schema"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:call-template name="keyvalue"/>
|
<xsl:call-template name="keyvalue"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="schema">
|
<xsl:template name="schema">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<xsl:if test="contains(.,'unstored')">
|
<xsl:if test="contains(.,'unstored')">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="not(contains(.,'unstored'))">
|
<xsl:if test="not(contains(.,'unstored'))">
|
||||||
<xsl:call-template name="infochar2string">
|
<xsl:call-template name="infochar2string">
|
||||||
<xsl:with-param name="charList">
|
<xsl:with-param name="charList">
|
||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="infochar2string">
|
<xsl:template name="infochar2string">
|
||||||
<xsl:param name="i">1</xsl:param>
|
<xsl:param name="i">1</xsl:param>
|
||||||
<xsl:param name="charList"/>
|
<xsl:param name="charList"/>
|
||||||
|
|
||||||
<xsl:variable name="char">
|
<xsl:variable name="char">
|
||||||
<xsl:value-of select="substring($charList,$i,1)"/>
|
<xsl:value-of select="substring($charList,$i,1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$char='I'">
|
<xsl:when test="$char='I'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='I']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='I']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='T'">
|
<xsl:when test="$char='T'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='T']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='T']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='S'">
|
<xsl:when test="$char='S'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='S']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='S']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='M'">
|
<xsl:when test="$char='M'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='M']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='M']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='V'">
|
<xsl:when test="$char='V'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='V']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='V']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='o'">
|
<xsl:when test="$char='o'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='o']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='o']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='p'">
|
<xsl:when test="$char='p'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='p']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='p']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='O'">
|
<xsl:when test="$char='O'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='O']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='O']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='L'">
|
<xsl:when test="$char='L'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='L']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='L']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='B'">
|
<xsl:when test="$char='B'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='B']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='B']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='C'">
|
<xsl:when test="$char='C'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='C']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='C']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='f'">
|
<xsl:when test="$char='f'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='f']"/> - </xsl:when>
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='f']"/> - </xsl:when>
|
||||||
<xsl:when test="$char='l'">
|
<xsl:when test="$char='l'">
|
||||||
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='l']"/> -
|
<xsl:value-of select="/response/lst[@name='info']/lst/str[@name='l']"/> -
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
||||||
<xsl:if test="not($i>=string-length($charList))">
|
<xsl:if test="not($i>=string-length($charList))">
|
||||||
<xsl:call-template name="infochar2string">
|
<xsl:call-template name="infochar2string">
|
||||||
<xsl:with-param name="i">
|
<xsl:with-param name="i">
|
||||||
<xsl:value-of select="$i+1"/>
|
<xsl:value-of select="$i+1"/>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
<xsl:with-param name="charList">
|
<xsl:with-param name="charList">
|
||||||
<xsl:value-of select="$charList"/>
|
<xsl:value-of select="$charList"/>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template name="css">
|
<xsl:template name="css">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
td.name {font-style: italic; font-size:80%; }
|
td.name {font-style: italic; font-size:80%; }
|
||||||
.doc { margin: 0.5em; border: solid grey 1px; }
|
.doc { margin: 0.5em; border: solid grey 1px; }
|
||||||
.exp { display: none; font-family: monospace; white-space: pre; }
|
.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;}
|
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 { width: auto; vertical-align: bottom; }
|
||||||
table.histogram td, table.histogram th { text-align: center; vertical-align: bottom; border-bottom: 1px solid #ff9933; width: auto; }
|
table.histogram td, table.histogram th { text-align: center; vertical-align: bottom; border-bottom: 1px solid #ff9933; width: auto; }
|
||||||
]]>
|
]]>
|
||||||
</style>
|
</style>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
34
solr/exampleSolr/solr.xml
Normal file
34
solr/exampleSolr/solr.xml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
All (relative) paths are relative to the installation path
|
||||||
|
|
||||||
|
persistent: Save changes made via the API to this file
|
||||||
|
sharedLib: path to a lib directory that will be shared across all cores
|
||||||
|
-->
|
||||||
|
<solr persistent="false">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
adminPath: RequestHandler path to manage cores.
|
||||||
|
If 'null' (or absent), cores will not be manageable via request handler
|
||||||
|
-->
|
||||||
|
<cores adminPath="/admin/cores" defaultCoreName="collection1">
|
||||||
|
<core name="collection1" instanceDir="." />
|
||||||
|
</cores>
|
||||||
|
</solr>
|
BIN
webapp/lib/apache-solr-analysis-extras-3.1.0.jar
Normal file
BIN
webapp/lib/apache-solr-analysis-extras-3.1.0.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
webapp/lib/apache-solr-core-3.1.0.jar
Normal file
BIN
webapp/lib/apache-solr-core-3.1.0.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
webapp/lib/apache-solr-solrj-3.1.0.jar
Normal file
BIN
webapp/lib/apache-solr-solrj-3.1.0.jar
Normal file
Binary file not shown.
|
@ -14,7 +14,6 @@ import net.sf.jga.fn.UnaryFunctor;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.solr.analysis.HTMLStripReader;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
|
@ -141,23 +140,27 @@ public abstract class VitroHighlighter extends UnaryFunctor<String,String> {
|
||||||
|
|
||||||
private final String stripHtml(String in){
|
private final String stripHtml(String in){
|
||||||
/* make a string with html stripped out */
|
/* make a string with html stripped out */
|
||||||
Reader stripIn =new HTMLStripReader( new StringReader( in ) );
|
// ryounes 5/16/2011 Broken with upgrade to Solr 3.1: HTMLStripReader has been removed.
|
||||||
StringWriter stripOut = new StringWriter(in.length());
|
// According to change list, should use HTMLStripCharFilter, but it's not immediately clear how
|
||||||
|
// to migrate this code. Will enter Jira issue.
|
||||||
char bytes[] = new char[5000];
|
// Reader stripIn = new HTMLStripReader( new StringReader( in ) );
|
||||||
int bytesRead = 0;
|
// StringWriter stripOut = new StringWriter(in.length());
|
||||||
try {
|
//
|
||||||
//this is a mess, there must be a better way to do this.
|
// char bytes[] = new char[5000];
|
||||||
while ( true ){
|
// int bytesRead = 0;
|
||||||
bytesRead = stripIn.read( bytes );
|
// try {
|
||||||
if( bytesRead == -1 ) break;
|
// //this is a mess, there must be a better way to do this.
|
||||||
stripOut.write(bytes, 0, bytesRead );
|
// while ( true ){
|
||||||
}
|
// bytesRead = stripIn.read( bytes );
|
||||||
} catch (IOException e1) {
|
// if( bytesRead == -1 ) break;
|
||||||
log.error("LuceneHighlighter.getHighlightFragments()" +
|
// stripOut.write(bytes, 0, bytesRead );
|
||||||
" - unable to strip html" + e1);
|
// }
|
||||||
}
|
// } catch (IOException e1) {
|
||||||
return stripOut.toString();
|
// log.error("LuceneHighlighter.getHighlightFragments()" +
|
||||||
|
// " - unable to strip html" + e1);
|
||||||
|
// }
|
||||||
|
// return stripOut.toString();
|
||||||
|
return in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class PagedSearchController extends FreemarkerHttpServlet implements Sear
|
||||||
//There may be other non-html formats in the future
|
//There may be other non-html formats in the future
|
||||||
Format format = getFormat(vreq);
|
Format format = getFormat(vreq);
|
||||||
boolean wasXmlRequested = Format.XML == format;
|
boolean wasXmlRequested = Format.XML == format;
|
||||||
log.debug("xml was the requested format");
|
log.debug("Requested format was " + (wasXmlRequested ? "xml" : "html"));
|
||||||
boolean wasHtmlRequested = ! wasXmlRequested;
|
boolean wasHtmlRequested = ! wasXmlRequested;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -128,7 +128,7 @@ public class SolrPagedSearchController extends FreemarkerHttpServlet {
|
||||||
//There may be other non-html formats in the future
|
//There may be other non-html formats in the future
|
||||||
Format format = getFormat(vreq);
|
Format format = getFormat(vreq);
|
||||||
boolean wasXmlRequested = Format.XML == format;
|
boolean wasXmlRequested = Format.XML == format;
|
||||||
log.debug("xml was the requested format");
|
log.debug("Requested format was " + (wasXmlRequested ? "xml" : "html"));
|
||||||
boolean wasHtmlRequested = ! wasXmlRequested;
|
boolean wasHtmlRequested = ! wasXmlRequested;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue