Skip to content

Instantly share code, notes, and snippets.

@lbjay
Created September 7, 2010 19:50
Show Gist options
  • Select an option

  • Save lbjay/568973 to your computer and use it in GitHub Desktop.

Select an option

Save lbjay/568973 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">4</int><lst name="params"><str name="id">10525</str><str name="qt">document</str><str name="debugQuery">true</str></lst></lst><result name="response" numFound="0" start="0"/><lst name="debug"><str name="rawquerystring">{!raw f=id v=$id}</str><str name="querystring">{!raw f=id v=$id}</str><str name="parsedquery">id:EXCEPTION(val=10525)</str><str name="parsedquery_toString">id:10525</str><lst name="explain"/><str name="QParser"/><lst name="timing"><double name="time">2.0</double><lst name="prepare"><double name="time">0.0</double><lst name="org.apache.solr.handler.component.QueryComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.FacetComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.MoreLikeThisComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.HighlightComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.StatsComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.DebugComponent"><double name="time">0.0</double></lst></lst><lst name="process"><double name="time">1.0</double><lst name="org.apache.solr.handler.component.QueryComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.FacetComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.MoreLikeThisComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.HighlightComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.StatsComponent"><double name="time">0.0</double></lst><lst name="org.apache.solr.handler.component.DebugComponent"><double name="time">1.0</double></lst></lst></lst></lst>
</response>
<?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.
-->
<schema name="example" version="1.2">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="ads_author" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="ads_author_syn" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="author.synonyms" ignoreCase="true" expand="true"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="ads_text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="ads_text_syn" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="text.kill" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="text.synonyms" ignoreCase="true" expand="true"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="text.kill" enablePositionIncrements="true" />
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>
<fieldtype name="ignored" stored="false" indexed="false" class="solr.StrField" />
</types>
<fields>
<field name="id" type="int" indexed="true" stored="true" required="true" />
<field name="doi" type="string" indexed="true" stored="true"/>
<field name="journal" type="string" indexed="true" stored="true"/>
<field name="monograph" type="string" indexed="true" stored="true"/>
<field name="bibcode" type="string" indexed="true" stored="true"/>
<field name="publisher" type="string" indexed="true" stored="true"/>
<field name="issn" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="isbn" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="volume" type="string" indexed="true" stored="true"/>
<field name="issue" type="int" indexed="true" stored="true"/>
<field name="spage" type="int" indexed="true" stored="true"/>
<field name="ft_source" type="string" indexed="true" stored="true"/>
<field name="database" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="private" type="boolean" indexed="true" stored="true" />
<!-- commonly faceted fields -->
<field name="pubyear" type="sint" indexed="true" stored="true"/>
<field name="author" type="ads_author" indexed="true" stored="true" multiValued="true"/>
<field name="author_syn" type="ads_author_syn" indexed="true" stored="false" multiValued="true"/>
<field name="author_facet" type="string" indexed="true" stored="false" multiValued="true"/>
<field name="keyword" type="ads_text" indexed="true" stored="true" multiValued="true"/>
<field name="keyword_facet" type="string" indexed="true" stored="false" multiValued="true"/>
<field name="affiliation" type="ads_text" indexed="true" stored="true" multiValued="true"/>
<field name="affiliation_facet" type="string" indexed="true" stored="false" multiValued="true"/>
<field name="facility" type="ads_text" indexed="true" stored="true" multiValued="true"/>
<field name="facility_facet" type="string" indexed="true" stored="false" multiValued="true"/>
<!-- primary text fields -->
<field name="title" type="ads_text" indexed="true" stored="true" multiValued="true" termVectors="true" termOffsets="true" termPositions="true"/>
<field name="abstract" type="ads_text" indexed="true" stored="true" termVectors="true" termOffsets="true" termPositions="true"/>
<field name="body" type="ads_text" indexed="true" stored="true" termVectors="true" termOffsets="true" termPositions="true"/>
<field name="all" type="ads_text" indexed="true" stored="false"/>
<!-- fields that use synonym expansion -->
<field name="title_syn" type="ads_text_syn" indexed="true" stored="false" multiValued="true" />
<field name="abstract_syn" type="ads_text_syn" indexed="true" stored="false" />
<field name="body_syn" type="ads_text_syn" indexed="true" stored="false" />
<field name="all_syn" type="ads_text_syn" indexed="true" stored="false"/>
<dynamicField name="extlink__*" type="string" indexed="true" store="true" multiValued="true"/>
<dynamicField name="inline__*" type="string" indexed="true" store="true" multiValued="true"/>
<!-- ignore everything else -->
<dynamicField name="*" type="ignored" multiValued="true" />
</fields>
<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
-->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>all</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
<copyField source="title" dest="all"/>
<copyField source="abstract" dest="all"/>
<copyField source="keyword" dest="all"/>
<copyField source="author" dest="all"/>
<copyField source="facility" dest="all"/>
<copyField source="body" dest="all"/>
<copyField source="author" dest="author_facet"/>
<copyField source="keyword" dest="keyword_facet"/>
<copyField source="facility" dest="facility_facet"/>
<copyField source="affiliation" dest="affiliation_facet"/>
<copyField source="author" dest="author_syn"/>
<copyField source="title" dest="title_syn"/>
<copyField source="abstract" dest="abstract_syn"/>
<copyField source="body" dest="body_syn"/>
<copyField source="all" dest="all_syn"/>
</schema>
<?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 a stripped down config file used for a simple example...
It is *not* a good example to work from.
-->
<config>
<updateHandler class="solr.DirectUpdateHandler2" >
<autoCommit>
<maxDocs>10000</maxDocs> <!-- maximum uncommited docs before autocommit triggered -->
</autoCommit>
</updateHandler>
<requestDispatcher handleSelect="true" >
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
</requestDispatcher>
<searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/>
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true" >
<lst name="defaults">
<bool name="tv">true</bool>
<str name="q">*:*</str>
<str name="df">body</str>
<str name="q.op">AND</str>
<str name="echoParams">explicit</str>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
<requestHandler name="/invenio_ft" class="solr.SearchHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="rows">1000</str>
<str name="fl">bibcode</str>
<str name="version">2.1</str>
<str name="q.op">AND</str>
<str name="df">body</str>
<str name="wt">json</str>
<str name="fq">ft_source:[* TO *]</str>
</lst>
</requestHandler>
<requestHandler name="/invenio_facets" class="solr.SearchHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="rows">0</str>
<str name="version">2.1</str>
<str name="q.op">OR</str>
<str name="df">bibcode</str>
<str name="wt">json</str>
<str name="facet">true</str>
<str name="facet.field">journal</str>
<str name="facet.field">author_facet</str>
<str name="facet.field">keyword_facet</str>
<str name="facet.field">pubyear_facet</str>
<str name="facet.field">facility_facet</str>
<str name="facet.field">affiliation_facet</str>
<str name="facet.limit">20</str>
<str name="facet.mincount">1</str>
</lst>
</requestHandler>
<requestHandler name="dismax" class="solr.SearchHandler" >
<lst name="defaults">
<bool name="tv">true</bool>
<str name="q.alt">*:*</str>
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<float name="tie">0.01</float>
<str name="qf">
body^0.5 abstract^1.0 author^1.2 bibcode^10.0 id^10.0 keyword^1.5
</str>
<!--
<str name="pf">
text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
</str>
<str name="bf">
popularity^0.5 recip(price,1,1000,1000)^0.3
</str>
<str name="fl">
id,name,price,score
</str>
-->
<str name="mm">
2&lt;-1 5&lt;-2 6&lt;90%
</str>
<int name="ps">100</int>
<str name="q.alt">id:0</str>
<!-- example highlighter config, enable per-query with hl=true -->
<str name="hl.fl">abstract body title</str>
<!-- for this field, we want no fragmenting, just highlighting -->
<str name="f.name.hl.fragsize">0</str>
<!-- instructs Solr to return the field itself if no query terms are
found -->
<!--
<str name="f.name.hl.alternateField">name</str>
<str name="f.text.hl.fragmenter">regex</str>
-->
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
<requestHandler name="search" class="solr.SearchHandler">
<lst name="defaults">
<str name="q">*:*</str>
<str name="echoParams">explicit</str>
<str name="fl">*,score</str>
<str name="facet">true</str>
<str name="facet.mincount">1</str>
<str name="facet.sort">true</str>
</lst>
</requestHandler>
<requestHandler name="document" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="fl">*</str>
<str name="rows">1</str>
<str name="q">{!raw f=id v=$id}</str>
</lst>
</requestHandler>
<query>
<!-- Maximum number of clauses in a boolean query... in the past, this affected
range or prefix queries that expanded to big boolean queries - built in Solr
query parsers no longer create queries with this limitation.
An exception is thrown if exceeded. -->
<maxBooleanClauses>1024</maxBooleanClauses>
<!-- There are two implementations of cache available for Solr,
LRUCache, based on a synchronized LinkedHashMap, and
FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets
and slower puts in single threaded operation and thus is generally faster
than LRUCache when the hit ratio of the cache is high (> 75%), and may be
faster under other scenarios on multi-cpu systems. -->
<!-- Cache used by SolrIndexSearcher for filters (DocSets),
unordered sets of *all* documents that match a query.
When a new searcher is opened, its caches may be prepopulated
or "autowarmed" using data from caches in the old searcher.
autowarmCount is the number of items to prepopulate. For LRUCache,
the autowarmed items will be the most recently accessed items.
Parameters:
class - the SolrCache implementation LRUCache or FastLRUCache
size - the maximum number of entries in the cache
initialSize - the initial capacity (number of entries) of
the cache. (seel java.util.HashMap)
autowarmCount - the number of entries to prepopulate from
and old cache.
-->
<filterCache
class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Cache used to hold field values that are quickly accessible
by document id. The fieldValueCache is created by default
even if not configured here.
<fieldValueCache
class="solr.FastLRUCache"
size="512"
autowarmCount="128"
showItems="32"
/>
-->
<!-- queryResultCache caches results of searches - ordered lists of
document ids (DocList) based on a query, a sort, and the range
of documents requested. -->
<queryResultCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- documentCache caches Lucene Document objects (the stored fields for each document).
Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
<documentCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- If true, stored fields that are not requested will be loaded lazily.
This can result in a significant speed improvement if the usual case is to
not load all stored fields, especially if the skipped fields are large
compressed text fields.
-->
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<!-- Example of a generic cache. These caches may be accessed by name
through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
The purpose is to enable easy caching of user/application level data.
The regenerator argument should be specified as an implementation
of solr.search.CacheRegenerator if autowarming is desired. -->
<!--
<cache name="myUserCache"
class="solr.LRUCache"
size="4096"
initialSize="1024"
autowarmCount="1024"
regenerator="org.mycompany.mypackage.MyRegenerator"
/>
-->
<!-- An optimization that attempts to use a filter to satisfy a search.
If the requested sort does not include score, then the filterCache
will be checked for a filter matching the query. If found, the filter
will be used as the source of document ids, and then the sort will be
applied to that.
<useFilterForSortedQuery>true</useFilterForSortedQuery>
-->
<!-- An optimization for use with the queryResultCache. When a search
is requested, a superset of the requested number of document ids
are collected. For example, if a search for a particular query
requests matching documents 10 through 19, and queryWindowSize is 50,
then documents 0 through 49 will be collected and cached. Any further
requests in that range can be satisfied via the cache. -->
<queryResultWindowSize>20</queryResultWindowSize>
<!-- Maximum number of documents to cache for any entry in the
queryResultCache. -->
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
<!-- a newSearcher event is fired whenever a new searcher is being prepared
and there is a current searcher handling requests (aka registered).
It can be used to prime certain caches to prevent long request times for
certain requests.
-->
<!-- QuerySenderListener takes an array of NamedList and executes a
local query request for each NamedList in sequence. -->
<listener event="newSearcher" class="solr.QuerySenderListener">
<arr name="queries">
<!--
<lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
<lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
<lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
-->
</arr>
</listener>
<!-- a firstSearcher event is fired whenever a new searcher is being
prepared but there is no current registered searcher to handle
requests or to gain autowarming data from. -->
<listener event="firstSearcher" class="solr.QuerySenderListener">
<arr name="queries">
<lst> <str name="q">cluster galaxy</str><str name="start">0</str><str name="rows">10</str></lst>
<lst> <str name="q">weak lensing</str><str name="start">0</str><str name="rows">10</str></lst>
</arr>
</listener>
<!-- If a search request comes in and there is no current registered searcher,
then immediately register the still warming searcher and use it. If
"false" then all requests will block until the first searcher is done
warming. -->
<useColdSearcher>false</useColdSearcher>
<!-- Maximum number of searchers that may be warming in the background
concurrently. An error is returned if this limit is exceeded. Recommend
1-2 for read-only slaves, higher for masters w/o cache warming. -->
<maxWarmingSearchers>2</maxWarmingSearchers>
</query>
<!-- config for the admin interface -->
<admin>
<defaultQuery>solr</defaultQuery>
</admin>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment