Schema validator/debugger

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Schema validator/debugger

Andrew Nagy-2
Does anyone have a good method of debugging a schema?
I have been struggling to get my new schema to run for the past couple
of days and just do not see anything wrong with the XML document.

Thanks
Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Ryan McKinley
What errors are you getting?  Are there exceptions in the log when it starts up?

On 4/10/07, Andrew Nagy <[hidden email]> wrote:
> Does anyone have a good method of debugging a schema?
> I have been struggling to get my new schema to run for the past couple
> of days and just do not see anything wrong with the XML document.
>
> Thanks
> Andrew
>
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
Ryan McKinley wrote:
> What errors are you getting?  Are there exceptions in the log when it
> starts up?
Just a null pointer exception.

I added a few fields to my schema, and then replaced my solr war file
with the latest build (see my message from a week ago).  It wouldn't
work, so I assumed something wrong with the latest build.  I then
reverted back to my 1.1.0 copy and am getting these errors.  The XML is
valid, but that is all I can test.

Here is a snapshot of my logs, everything starts up fine - but then I
click on "ping" and get a server error:

INFO: Deploying web application archive solr.war
Apr 10, 2007 11:35:23 AM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init()
Apr 10, 2007 11:35:23 AM org.apache.solr.servlet.SolrServlet init
INFO: No /solr/home in JNDI
Apr 10, 2007 11:35:23 AM org.apache.solr.servlet.SolrServlet init
INFO: user.dir=/office/local
Apr 10, 2007 11:35:23 AM org.apache.solr.core.Config getInstanceDir
INFO: Solr home defaulted to 'solr/'
Apr 10, 2007 11:35:23 AM org.apache.solr.core.SolrConfig initConfig
INFO: Loaded SolrConfig: solrconfig.xml
Apr 10, 2007 11:35:23 AM org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler standard=solr.StandardRequestHandler
Apr 10, 2007 11:35:23 AM org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler dismax=solr.DisMaxRequestHandler
Apr 10, 2007 11:35:23 AM org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler partitioned=solr.DisMaxRequestHandler
Apr 10, 2007 11:35:23 AM org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler instock=solr.DisMaxRequestHandler
Apr 10, 2007 11:35:23 AM org.apache.solr.core.SolrCore <init>
INFO: Opening new SolrCore at solr/, dataDir=solr/data
Apr 10, 2007 11:35:23 AM org.apache.solr.schema.IndexSchema readConfig
INFO: Reading Solr Schema
Apr 10, 2007 11:35:23 AM org.apache.solr.schema.IndexSchema readConfig
INFO: Schema name=example
Apr 10, 2007 11:35:23 AM org.apache.solr.schema.IndexSchema readConfig
INFO: default search field is title
Apr 10, 2007 11:35:23 AM org.apache.solr.schema.IndexSchema readConfig
INFO: query parser default operator is OR
Apr 10, 2007 11:35:23 AM org.apache.solr.schema.IndexSchema readConfig
INFO: unique key field: id
Apr 10, 2007 11:35:23 AM org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done
Apr 10, 2007 11:35:24 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8081
Apr 10, 2007 11:35:24 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 10, 2007 11:35:24 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/25  config=null
Apr 10, 2007 11:35:24 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 10, 2007 11:35:24 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2659 ms
Apr 10, 2007 11:35:40 AM org.apache.solr.core.SolrException log
SEVERE: java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:363)
        at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:259)
        at
org.apache.solr.request.SolrQueryRequestBase.getSearcher(SolrQueryRequestBase.java:152)
        at
org.apache.solr.request.DisMaxRequestHandler.handleRequest(DisMaxRequestHandler.java:231)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:595)
        at org.apache.jsp.admin.ping_jsp._jspService(ping_jsp.java:75)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
        at java.io.File.<init>(File.java:194)
        at
org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:149)
        at
org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:131)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:126)
        at
org.apache.solr.search.SolrIndexSearcher.<init>(SolrIndexSearcher.java:85)
        at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:354)
        ... 25 more

Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
Andrew Nagy wrote:

> Ryan McKinley wrote:
>> What errors are you getting?  Are there exceptions in the log when it
>> starts up?
> Just a null pointer exception.
>
> I added a few fields to my schema, and then replaced my solr war file
> with the latest build (see my message from a week ago).  It wouldn't
> work, so I assumed something wrong with the latest build.  I then
> reverted back to my 1.1.0 copy and am getting these errors.  The XML
> is valid, but that is all I can test.

I just installed SOLR-75 patch and the "schema browser" is able to view
the schema perfectly.  When I used the default schema with SOLR,
everything is fine, but when I replace my schema ... it's throws this
NullPointerException ....

Any ideas?

Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Ryan McKinley
Are you using the example solrconfig.xml?  The stack trace looks like
an error finding the solr.home index directory, that is configured in
solrconfig.xml, not schema.xml

If the example schema.xml works, can you try adding a little bit of
your schema at a time?



On 4/11/07, Andrew Nagy <[hidden email]> wrote:

> Andrew Nagy wrote:
> > Ryan McKinley wrote:
> >> What errors are you getting?  Are there exceptions in the log when it
> >> starts up?
> > Just a null pointer exception.
> >
> > I added a few fields to my schema, and then replaced my solr war file
> > with the latest build (see my message from a week ago).  It wouldn't
> > work, so I assumed something wrong with the latest build.  I then
> > reverted back to my 1.1.0 copy and am getting these errors.  The XML
> > is valid, but that is all I can test.
>
> I just installed SOLR-75 patch and the "schema browser" is able to view
> the schema perfectly.  When I used the default schema with SOLR,
> everything is fine, but when I replace my schema ... it's throws this
> NullPointerException ....
>
> Any ideas?
>
> Andrew
>
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
Ryan McKinley wrote:
> Are you using the example solrconfig.xml?  The stack trace looks like
> an error finding the solr.home index directory, that is configured in
> solrconfig.xml, not schema.xml
Yeah, I noticed that too ... but I don't understand why it can't find
the home.  I have the data home set to ./solr/data and I always start
tomcat from the parent directory.
>
> If the example schema.xml works, can you try adding a little bit of
> your schema at a time?
Yeah, that is my last resort.  I guess I have no choice!

Thanks
Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Yonik Seeley-2
On 4/11/07, Andrew Nagy <[hidden email]> wrote:
> > If the example schema.xml works, can you try adding a little bit of
> > your schema at a time?
> Yeah, that is my last resort.  I guess I have no choice!

That certainly is strange... Sounds like you definitely hit some sort
of Solr bug, but I don't see how an error in schema parsing can be
lost w/o it going into a log somewhere.  Did you check the other
Tomcat log files?

Perhaps try putting your schema.xml into the example distributed with
Solr (jetty based) and see what happens.

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Greg Ludington
In reply to this post by Andrew Nagy-2
> I just installed SOLR-75 patch and the "schema browser" is able to view
> the schema perfectly.  When I used the default schema with SOLR,
> everything is fine, but when I replace my schema ... it's throws this
> NullPointerException ....

One thing to note is that the "schema browser" as currently in SOLR-75
just transforms the xml file -- it does not represent any of the
actual parsing of the configuration by Solr upon startup, and so would
not be able to catch any errors Solr might encounter in the schema.

-Greg
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
Greg Ludington wrote:
>> I just installed SOLR-75 patch and the "schema browser" is able to view
>> the schema perfectly.  When I used the default schema with SOLR,
>> everything is fine, but when I replace my schema ... it's throws this
>> NullPointerException ....
>
> One thing to note is that the "schema browser" as currently in SOLR-75
> just transforms the xml file -- it does not represent any of the
> actual parsing of the configuration by Solr upon startup, and so would
> not be able to catch any errors Solr might encounter in the schema.
Sure, but it's an easier way for my non-textual brain to grasp the
schema file :)

Nice job, BTW.

Off topic a bit, Has anyone set forth to build a new admin interface for
SOLR?  I build a lot of admin interfaces for my day job and would love
to give the admin module a bit of a tune-up (I won't use the term overhaul).


Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
In reply to this post by Andrew Nagy-2
Andrew Nagy wrote:
> Ryan McKinley wrote:
>> If the example schema.xml works, can you try adding a little bit of
>> your schema at a time?
> Yeah, that is my last resort.  I guess I have no choice!
So I did this, and I ended up removing all of my fields and copyfields
with still no luck.  I took a fresh copy of the example schema, replaced
my fields and copyfields and it still the error persists.

One thing I noticed is that in the admin it goes from "Solr Admin
(example)" to "Solr Admin (unknown)" which makes me think it is having a
hard time parsing the schema file?

Would it help if I posted my schema file?

Thanks!
Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
In reply to this post by Yonik Seeley-2
Yonik Seeley wrote:
> On 4/11/07, Andrew Nagy <[hidden email]> wrote:
>> > If the example schema.xml works, can you try adding a little bit of
>> > your schema at a time?
>> Yeah, that is my last resort.  I guess I have no choice!
>
> That certainly is strange... Sounds like you definitely hit some sort
> of Solr bug, but I don't see how an error in schema parsing can be
> lost w/o it going into a log somewhere.  Did you check the other
> Tomcat log files?
The only tomcat log file that has any mention of an error is catalina.out
>
> Perhaps try putting your schema.xml into the example distributed with
> Solr (jetty based) and see what happens.
I can try this.  Will jetty create a log file somewhere?

Thanks
Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Ryan McKinley
In reply to this post by Andrew Nagy-2
>
> Off topic a bit, Has anyone set forth to build a new admin interface for
> SOLR?  I build a lot of admin interfaces for my day job and would love
> to give the admin module a bit of a tune-up (I won't use the term overhaul).
>

i think we definitely need an updated admin interface, yes!

Ideally, we could get rid of all the JSP and do everything with
requestHandlers + XSLT.  Then everything could work with only a JRE -
it would not require a JDK and all the jsp jars.  AND this would let
other clients have access to the same info with JSON/xml etc

check:
http://issues.apache.org/jira/browse/SOLR-162

This puts a lot of the functionality as handlers, but still needs an
XSLT front end
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Ryan McKinley
In reply to this post by Andrew Nagy-2
>
> Would it help if I posted my schema file?
>

yes
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
In reply to this post by Ryan McKinley
Ryan McKinley wrote:

>>
>> Off topic a bit, Has anyone set forth to build a new admin interface for
>> SOLR?  I build a lot of admin interfaces for my day job and would love
>> to give the admin module a bit of a tune-up (I won't use the term
>> overhaul).
>>
>
> i think we definitely need an updated admin interface, yes!
>
> Ideally, we could get rid of all the JSP and do everything with
> requestHandlers + XSLT.  Then everything could work with only a JRE -
> it would not require a JDK and all the jsp jars.  AND this would let
> other clients have access to the same info with JSON/xml etc
>
> check:
> http://issues.apache.org/jira/browse/SOLR-162
>
> This puts a lot of the functionality as handlers, but still needs an
> XSLT front end
Yes, Erik Hatcher showed this off a bit at a conference I was at in
February.  I was thinking about building off of these xml files.  I do
quite a bit with XSLT in my day job, so I would love to play around with
it.  I think this is something that is desperately needed in SOLR, I
know it would make my life a lot easier :)

I will take a stab at some of this soon ...

Andrew


Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Yonik Seeley-2
In reply to this post by Ryan McKinley
On 4/11/07, Ryan McKinley <[hidden email]> wrote:
> > Off topic a bit, Has anyone set forth to build a new admin interface for
> > SOLR?  I build a lot of admin interfaces for my day job and would love
> > to give the admin module a bit of a tune-up (I won't use the term overhaul).
>
> i think we definitely need an updated admin interface, yes!

I agree.  We've never put much emphasis on the admin pages, and they
could really use more functionality and a fresher look.

> Ideally, we could get rid of all the JSP and do everything with
> requestHandlers + XSLT.

Seems rather pointless if the look or functionality isn't improved.
I'd personally find it much harder to debug or enhance pages that try
to do *everything* in XSLT.

Where it makes sense to export info programatically, a request handler
can be used, but that's certainly not in all the cases.

> Then everything could work with only a JRE -

AFAIK, all of the newest servlet containers can run off a JRE.  When
Jetty 6.1 becomes stable, we should use that in the example.

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Otis Gospodnetic-2
In reply to this post by Andrew Nagy-2
Re Jetty 6.1 becoming stable - it's getting there.  I'm on the ML and see fewer bugs reported.  They are on 6.1.2rc3 I believe.

Otis

----- Original Message ----
From: Yonik Seeley <[hidden email]>


> Then everything could work with only a JRE -

AFAIK, all of the newest servlet containers can run off a JRE.  When
Jetty 6.1 becomes stable, we should use that in the example.

-Yonik



Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
In reply to this post by Ryan McKinley
So maybe I am doing something really dumb, but for testing purposes I
took a copy of the example schema.xml file and removed all of the fields
except for 2 to start with something really basic and it is throwing the
nullpointerexception again.

I attached the file if it is of any help

I am using a fresh copy of the nightly build.

Ryan McKinley wrote:
>>
>> Would it help if I posted my schema file?
>>
>
> yes

<?xml version="1.0" ?>
<!--
 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 the Solr schema file. This file should be named "schema.xml" and
 should be in the conf directory under the solr home
 (i.e. ./solr/conf/schema.xml by default)
 or located where the classloader for the Solr webapp can find it.

 For more information, on how to customize this file, please see
 http://wiki.apache.org/solr/SchemaXml
-->

<schema name="example" version="1.1">
  <!-- attribute "name" is the name of this schema and is only used for display purposes.
       Applications should change this to reflect the nature of the search collection.
       version="1.1" is Solr's version number for the schema syntax and semantics.  It should
       not normally be changed by applications.
       1.0: multiValued attribute did not exist, all fields are multiValued by nature
       1.1: multiValued attribute introduced, false by default -->

  <types>
    <!-- field type definitions. The "name" attribute is
       just a label to be used by field definitions.  The "class"
       attribute and any other attributes determine the real
       behavior of the fieldtype.
         Class names starting with "solr" refer to java classes in the
       org.apache.solr.analysis package.
    -->

    <!-- The StrField type is not analyzed, but indexed/stored verbatim.  
       - StrField and TextField support an optional compressThreshold which
       limits compression (if enabled in the derived fields) to values which
       exceed a certain size (in characters).
    -->
    <fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

    <!-- boolean type: "true" or "false" -->
    <fieldtype name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>

    <!-- The optional sortMissingLast and sortMissingFirst attributes are
         currently supported on types that are sorted internally as strings.
       - If sortMissingLast="true", then a sort on this field will cause documents
         without the field to come after documents with the field,
         regardless of the requested sort order (asc or desc).
       - If sortMissingFirst="true", then a sort on this field will cause documents
         without the field to come before documents with the field,
         regardless of the requested sort order.
       - If sortMissingLast="false" and sortMissingFirst="false" (the default),
         then default lucene sorting will be used which places docs without the
         field first in an ascending sort and last in a descending sort.
    -->    


    <!-- numeric field types that store and index the text
         value verbatim (and hence don't support range queries, since the
         lexicographic ordering isn't equal to the numeric ordering) -->
    <fieldtype name="integer" class="solr.IntField" omitNorms="true"/>
    <fieldtype name="long" class="solr.LongField" omitNorms="true"/>
    <fieldtype name="float" class="solr.FloatField" omitNorms="true"/>
    <fieldtype name="double" class="solr.DoubleField" omitNorms="true"/>


    <!-- Numeric field types that manipulate the value into
         a string value that isn't human-readable in its internal form,
         but with a lexicographic ordering the same as the numeric ordering,
         so that range queries work correctly. -->
    <fieldtype name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
    <fieldtype name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
    <fieldtype name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
    <fieldtype name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>


    <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
         is a more restricted form of the canonical representation of dateTime
         http://www.w3.org/TR/xmlschema-2/#dateTime   
         The trailing "Z" designates UTC time and is mandatory.
         Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
         All other components are mandatory.

         Expressions can also be used to denote calculations that should be
         performed relative to "NOW" to determine the value, ie...

               NOW/HOUR
                  ... Round to the start of the current hour
               NOW-1DAY
                  ... Exactly 1 day prior to now
               NOW/DAY+6MONTHS+3DAYS
                  ... 6 months and 3 days in the future from the start of
                      the current day
                     
         Consult the DateField javadocs for more information.
      -->
    <fieldtype name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>

    <!-- solr.TextField allows the specification of custom text analyzers
         specified as a tokenizer and a list of token filters. Different
         analyzers may be specified for indexing and querying.

         The optional positionIncrementGap puts space between multiple fields of
         this type on the same document, with the purpose of preventing false phrase
         matching across fields.

         For more info on customizing your analyzer chain, please see
         http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
     -->

    <!-- One can also specify an existing Analyzer class that has a
         default constructor via the class attribute on the analyzer element
    <fieldtype name="text_greek" class="solr.TextField">
      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
    </fieldType>
    -->

    <!-- A text field that only splits on whitespace for exact matching of words -->
    <fieldtype name="text_ws" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      </analyzer>
    </fieldtype>

    <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of
        words on case-change, alpha numeric boundaries, and non-alphanumeric chars,
        so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi".
        Synonyms and stopwords are customized by external files, and stemming is enabled.
        Duplicate tokens at the same position (which may result from Stemmed Synonyms or
        WordDelim parts) are removed.
        -->
    <fieldtype name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldtype>


    <!-- Less flexible matching, but less false matches.  Probably not ideal for product names,
         but may be good for SKUs.  Can insert dashes in the wrong place and still match. -->
    <fieldtype name="textTight" class="solr.TextField" positionIncrementGap="100" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldtype>

 </types>


 <fields>
   <!-- Valid attributes for fields:
     name: mandatory - the name for the field
     type: mandatory - the name of a previously defined type from the <types> section
     indexed: true if this field should be indexed (searchable or sortable)
     stored: true if this field should be retrievable
     compressed: [false] if this field should be stored using gzip compression
       (this will only apply if the field type is compressable; among
       the standard field types, only TextField and StrField are)
     multiValued: true if this field may contain multiple values per document
     omitNorms: (expert) set to true to omit the norms associated with
       this field (this disables length normalization and index-time
       boosting for the field, and saves some memory).  Only full-text
       fields or fields that need an index-time boost need norms.
   -->

   <field name="id" type="string" indexed="true" stored="true"/>
   <field name="title" type="string" indexed="true" stored="true"/>

 </fields>

 <!-- field to use to determine and enforce document uniqueness. -->
 <uniqueKey>id</uniqueKey>

 <!-- field for the QueryParser to use when an explicit fieldname is absent -->
 <defaultSearchField>title</defaultSearchField>

 <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
 <solrQueryParser defaultOperator="OR"/>

  <!-- 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.  -->

 <!-- Similarity is the scoring routine for each document vs. a query.
      A custom similarity may be specified here, but the default is fine
      for most applications.  -->
 <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->

</schema>
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Yonik Seeley-2
I dropped your schema.xml directly into the Solr example (using
Jetty), fired it up, and everything works fine!?

Are you sure you are using the stock solrconfig.xml, etc?

-Yonik

On 4/12/07, Andrew Nagy <[hidden email]> wrote:

> So maybe I am doing something really dumb, but for testing purposes I
> took a copy of the example schema.xml file and removed all of the fields
> except for 2 to start with something really basic and it is throwing the
> nullpointerexception again.
>
> I attached the file if it is of any help
>
> I am using a fresh copy of the nightly build.
>
> Ryan McKinley wrote:
> >>
> >> Would it help if I posted my schema file?
> >>
> >
> > yes
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Andrew Nagy-2
Yonik Seeley wrote:
> I dropped your schema.xml directly into the Solr example (using
> Jetty), fired it up, and everything works fine!?
Okay, I switched over to Jetty and now I get a different error:
SEVERE: org.apache.solr.core.SolrException: undefined field text
>
> Are you sure you are using the stock solrconfig.xml, etc?
Yep.


I apologize ahead of time if I am being blatantly stupid about this. :)
Reply | Threaded
Open this post in threaded view
|

Re: Schema validator/debugger

Ryan McKinley
With a clean checkout, you can run:
$ ant example
$ cd example
$ java -jar start.jar

and things work OK.

But, when you delete all but the two fields, you get an exception somewhere?


On 4/12/07, Andrew Nagy <[hidden email]> wrote:

> Yonik Seeley wrote:
> > I dropped your schema.xml directly into the Solr example (using
> > Jetty), fired it up, and everything works fine!?
> Okay, I switched over to Jetty and now I get a different error:
> SEVERE: org.apache.solr.core.SolrException: undefined field text
> >
> > Are you sure you are using the stock solrconfig.xml, etc?
> Yep.
>
>
> I apologize ahead of time if I am being blatantly stupid about this. :)
>
12