On May 25, 2009, at 8:59 AM, Erik Hatcher wrote:
On May 25, 2009, at 8:51 AM, Mark Miller wrote:
Erik Hatcher wrote:
I saw Peter Wolanin mention this on IRC's #solr the other day (Hi
Peter, nice meeting you at the meetup the other night!), and I
just encountered it too:
HTTP ERROR: 500
org.apache.lucene.index.ReadOnlySegmentReader cannot be cast to
org.apache.solr.search.SolrIndexReader
java.lang.ClassCastException:
org.apache.lucene.index.ReadOnlySegmentReader cannot be cast to
org.apache.solr.search.SolrIndexReader
at org.apache.solr.search.DocSetBase$1.getDocIdSet(DocSet.java:
254)
at
org.apache.lucene.search.IndexSearcher.doSearch(IndexSearcher.java:
237)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:
221)
This comes from using an fq parameter:
http://localhost:8983/solr/select?q=*:*&fq=ipod
Works fine without fq.
Yikes!
Erik
Hmmm - what did you do leading up to it? I just tried a trunk
example, load docs, try search, and that doesn't seem to tickle it.
It appears that somehow, some code is passing in a lucene reader
that didnt come from SolrIndexSearcher (which wraps indexreader to
solrindexreader). I can't find the code that would be doing that
though. Was looking for a deeper stacktrace or something, but
havn't been able to tickle the bug yet.
Hmmm.... I guess I shouldn't have left out a couple of details, I'm
launching Solr like this: java -Dsolr.solr.home=../contrib/velocity/
src/main/solr/ -jar start.jar and I'm using the May 24 nightly build.
So it is using a different configuration, which is mostly a clone of
the example config, but apparently different in some respect. I'll
try with trunk and see. I mentioned trunk in the subject, sorry
about the misdirection.
I'll try on trunk now.
Ok, on trunk all is well with the default example configuration. But
breaks launching as mentioned above. Here's the diff in
solrconfig.xml pasted below. I guess the important diff is the LRU
cache setting? Is that the culprit?
Erik
~/dev/solr/example: diff solr/conf/solrconfig.xml ../contrib/velocity/
src/main/solr/conf/solrconfig.xml
212,217d211
< <!-- 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. -->
225c219
< class - the SolrCache implementation LRUCache or FastLRUCache
---
> class - the SolrCache implementation (currently only
LRUCache)
233c227
< class="solr.FastLRUCache"
---
> class="solr.LRUCache"
238,248d231
< <!-- 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"
< />
< -->
<
308a292,297
> <!-- This entry enables an int hash representation for filters
(DocSets)
> when the number of items in the set is less than maxSize.
For smaller
> sets, this representation is more memory efficient, more
efficient to
> iterate over, and faster to take intersections. -->
> <HashDocSet maxSize="3000" loadFactor="0.75"/>
>
351c340
< <requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000" />
---
> <requestParsers enableRemoteStreaming="false"
multipartUploadLimitInKB="2048" />
408a398
>
411,412c401,424
< <!-- Please refer to http://wiki.apache.org/solr/SolrReplication for
details on configuring replication -->
< <!--Master config-->
---
> <requestHandler name="/itas" class="solr.SearchHandler">
> <lst name="defaults">
> <str name="v.template">browse</str>
> <str name="v.properties">velocity.properties</str>
> <str name="title">Solritas</str>
>
> <str name="wt">velocity</str>
> <str name="defType">dismax</str>
> <str name="q.alt">*:*</str>
> <str name="rows">10</str>
> <str name="fl">*,score</str>
> <str name="facet">on</str>
> <str name="facet.field">cat</str>
> <str name="facet.mincount">1</str>
> <str name="qf">
> text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1
cat^1.4
> </str>
> </lst>
> <!--<lst name="invariants">-->
> <!--<str name="v.base_dir">/Users/erik/dev/solr/contrib/
velocity/src/main/templates</str>-->
> <!--</lst>-->
> </requestHandler>
>
> <!--Master config-->
423c435
< <requestHandler name="/replication" class="solr.ReplicationHandler">
---
> <requestHandler name="/replication" class="solr.ReplicationHandler" >
425c437
< <str name="masterUrl">http://localhost:8983/solr/
replication</str>
---
> <str name="masterUrl">http://localhost:8983/solr/
replication</str>
589,597c601,602
< <!-- A request handler utilizing the spellcheck component.
<
################################################################################################
< NOTE: This is purely as an example. The whole purpose of the
SpellCheckComponent is to hook it into
< the request handler that handles (i.e. the standard or dismax
SearchHandler)
< queries such that a separate request is not needed to get
suggestions.
<
< IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS NOT
WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
<
################################################################################################
< -->
---
> <!-- a request handler utilizing the spellcheck component. This
is purely as an example.
> You will likely want to add the component to your already
specified request handlers. -->
624,646d628
< <!--
< <requestHandler name="/update/extract"
class="org.apache.solr.handler.extraction.ExtractingRequestHandler">
< <lst name="defaults">
< <str name="ext.map.Last-Modified">last_modified</str>
< <bool name="ext.ignore.und.fl">true</bool>
< </lst>
< </requestHandler>
< -->
<
<
< <!-- A component to return terms and document frequency of those
terms.
< This component does not yet support distributed search. -->
< <searchComponent name="termsComponent"
class="org.apache.solr.handler.component.TermsComponent"/>
<
< <requestHandler name="/terms"
class="org.apache.solr.handler.component.SearchHandler">
< <lst name="defaults">
< <bool name="terms">true</bool>
< </lst>
< <arr name="components">
< <str>termsComponent</str>
< </arr>
< </requestHandler>
<
677,679d658
<
< <requestHandler name="/update/javabin"
class="solr.BinaryUpdateRequestHandler" />
<
681,686c660,661
< Analysis request handler. Since Solr 1.3. Use to return how a
document is analyzed. Useful
< for debugging and as a token server for other types of
applications.
<
< This is deprecated in favor of the improved
DocumentAnalysisRequestHandler and FieldAnalysisRequestHandler
<
< <requestHandler name="/analysis"
class="solr.AnalysisRequestHandler" />
---
> Analysis request handler. Since Solr 1.3. Use to returnhow a
document is analyzed. Useful
> for debugging and as a token server for other types of
applications
688,728c663
<
< <!--
< An analysis handler that provides a breakdown of the analysis
process of provided docuemnts. This handler expects a
< (single) content stream with the following format:
<
< <docs>
< <doc>
< <field name="id">1</field>
< <field name="name">The Name</field>
< <field name="text">The Text Value</field>
< <doc>
< <doc>...</doc>
< <doc>...</doc>
< ...
< </docs>
<
< Note: Each document must contain a field which serves as the
unique key. This key is used in the returned
< response to assoicate an analysis breakdown to the analyzed
document.
<
< Like the FieldAnalysisRequestHandler, this handler also supports
query analysis by
< sending either an "analysis.query" or "q" request paraemter that
holds the query text to be analyized. It also
< supports the "analysis.showmatch" parameter which when set to
true, all field tokens that match the query
< tokens will be marked as a "match".
< -->
< <requestHandler name="/analysis/document"
class="solr.DocumentAnalysisRequestHandler" />
<
< <!--
< RequestHandler that provides much the same functionality as
analysis.jsp. Provides the ability
< to specify multiple field types and field names in the same
request and outputs index-time and
< query-time analysis for each of them.
<
< Request parameters are:
< analysis.fieldname - The field name whose analyzers are to be used
< analysis.fieldtype - The field type whose analyzers are to be used
< analysis.fieldvalue - The text for index-time analysis
< q (or analysis.q) - The text for query time analysis
< analysis.showmatch (true|false) - When set to true and when
query analysis is performed, the produced
< tokens of the field value
analysis will be marked as "matched" for every
< token that is produces by the
query analysis
< -->
< <requestHandler name="/analysis/field"
class="solr.FieldAnalysisRequestHandler" />
---
> <requestHandler name="/analysis"
class="solr.AnalysisRequestHandler" />
803,820d737
< <!-- An example dedup update processor that creates the "id" field
on the fly
< based on the hash code of some other fields. This example
has overwriteDupes
< set to false since we are using the id field as the
signatureField and Solr
< will maintain uniqueness based on that anyway. -->
< <!--
< <updateRequestProcessorChain name="dedupe">
< <processor
class
="org.apache.solr.update.processor.SignatureUpdateProcessorFactory">
< <bool name="enabled">true</bool>
< <str name="signatureField">id</str>
< <bool name="overwriteDupes">false</bool>
< <str name="fields">name,features,cat</str>
< <str
name
="signatureClass">org.apache.solr.update.processor.Lookup3Signature</
str>
< </processor>
< <processor class="solr.LogUpdateProcessorFactory" />
< <processor class="solr.RunUpdateProcessorFactory" />
< </updateRequestProcessorChain>
< -->
<
838a756,757
> <queryResponseWriter name="velocity"
class="org.apache.solr.request.VelocityResponseWriter"/>
>
~/dev/solr/example: