You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by John Mohr <jt...@healthconresources.com> on 2006/03/24 20:45:07 UTC

What is proper way to re-init index?

I've been working with Solr for just a few days. Initially I ran the
exampldocs and things worked fine. I've now redefined the layout of the
index to be more of what I'd like to see, generated my own xml files to
index, blew away the old index/directories, restarted with the new schema
file and it only creates the index and segment directories but not the
complete index. Luke tells me I have a corrupted index. What is the proper
way to create the index? I can go back to the pre-expansion solr.war file
but that seems a bit drastic.

Re: What is proper way to re-init index?

Posted by Yonik Seeley <ys...@gmail.com>.
The easiest way to verify that you are using your schema is to go to
the admin page
and check out the schema name... it should say "Solr Admin (trial1)"
at the top of the page.

You can also click on the schema link to see the contents of the
schema file and verify that it's the most recent and contains the form
field.

-Yonik

On 3/27/06, Yonik Seeley <ys...@gmail.com> wrote:
> On 3/27/06, John Mohr <jt...@healthconresources.com> wrote:
> > So why wouldn't the "form" field be recognized?
>
> Your schema is correct, I tried it myself and it worked.
> My best guess is that Solr isn't actually reading your schema.xml, but
> the example one.
> Are you sure solrconf/schema.xml is your schema, and that you
> restarted the server so it would be re-read?
>
> -Yonik
>
>
> > -----Original Message-----
> > From: Yonik Seeley [mailto:yseeley@gmail.com]
> > Sent: Monday, March 27, 2006 10:17 AM
> > To: solr-user@lucene.apache.org
> > Subject: Re: What is proper way to re-init index?
> >
> >
> > Hi John,
> >
> > The error message "undefined field form" means Solr doesn't know about
> > the "form" field.
> > Did you copy your schema.xml to the example/solrconf directory and
> > restart the app server?
> >
> > I tried your schema and doc, and didn't get the error you did.  I got
> > an error further down due to and invalid date format (see schema.xml
> > comments for date type for the correct format).
> >
> > -Yonik
> >
> > (the weird stack trace showing an XML parsing error is due to Solr
> > trying to continue on to the next document even though the first had
> > an error... and it looks like this part of the code could use a little
> > work).
> >

RE: What is proper way to re-init index?

Posted by John Mohr <jt...@healthconresources.com>.
I was about to respond saying yes, I know it is correct, but it turns out
that while I had changed the solrconf directory, I hadn't restarted Jetty
that picks it up. After doing so, it worked fine. Thanks.

-----Original Message-----
From: Yonik Seeley [mailto:yseeley@gmail.com]
Sent: Monday, March 27, 2006 12:42 PM
To: solr-user@lucene.apache.org
Subject: Re: What is proper way to re-init index?


On 3/27/06, John Mohr <jt...@healthconresources.com> wrote:
> So why wouldn't the "form" field be recognized?

Your schema is correct, I tried it myself and it worked.
My best guess is that Solr isn't actually reading your schema.xml, but
the example one.
Are you sure solrconf/schema.xml is your schema, and that you
restarted the server so it would be re-read?

-Yonik


> -----Original Message-----
> From: Yonik Seeley [mailto:yseeley@gmail.com]
> Sent: Monday, March 27, 2006 10:17 AM
> To: solr-user@lucene.apache.org
> Subject: Re: What is proper way to re-init index?
>
>
> Hi John,
>
> The error message "undefined field form" means Solr doesn't know about
> the "form" field.
> Did you copy your schema.xml to the example/solrconf directory and
> restart the app server?
>
> I tried your schema and doc, and didn't get the error you did.  I got
> an error further down due to and invalid date format (see schema.xml
> comments for date type for the correct format).
>
> -Yonik
>
> (the weird stack trace showing an XML parsing error is due to Solr
> trying to continue on to the next document even though the first had
> an error... and it looks like this part of the code could use a little
> work).
>


Re: What is proper way to re-init index?

Posted by Yonik Seeley <ys...@gmail.com>.
On 3/27/06, John Mohr <jt...@healthconresources.com> wrote:
> So why wouldn't the "form" field be recognized?

Your schema is correct, I tried it myself and it worked.
My best guess is that Solr isn't actually reading your schema.xml, but
the example one.
Are you sure solrconf/schema.xml is your schema, and that you
restarted the server so it would be re-read?

-Yonik


> -----Original Message-----
> From: Yonik Seeley [mailto:yseeley@gmail.com]
> Sent: Monday, March 27, 2006 10:17 AM
> To: solr-user@lucene.apache.org
> Subject: Re: What is proper way to re-init index?
>
>
> Hi John,
>
> The error message "undefined field form" means Solr doesn't know about
> the "form" field.
> Did you copy your schema.xml to the example/solrconf directory and
> restart the app server?
>
> I tried your schema and doc, and didn't get the error you did.  I got
> an error further down due to and invalid date format (see schema.xml
> comments for date type for the correct format).
>
> -Yonik
>
> (the weird stack trace showing an XML parsing error is due to Solr
> trying to continue on to the next document even though the first had
> an error... and it looks like this part of the code could use a little
> work).
>

RE: What is proper way to re-init index?

Posted by John Mohr <jt...@healthconresources.com>.
So why wouldn't the "form" field be recognized? It's in the schema
(immediately after "ref"). In the meantime I'll play around with date. The
comments say it should be: "2006-03-27T12:36:00Z". Unless I hear otherwise
I'll assume that's correct.

-----Original Message-----
From: Yonik Seeley [mailto:yseeley@gmail.com]
Sent: Monday, March 27, 2006 10:17 AM
To: solr-user@lucene.apache.org
Subject: Re: What is proper way to re-init index?


Hi John,

The error message "undefined field form" means Solr doesn't know about
the "form" field.
Did you copy your schema.xml to the example/solrconf directory and
restart the app server?

I tried your schema and doc, and didn't get the error you did.  I got
an error further down due to and invalid date format (see schema.xml
comments for date type for the correct format).

-Yonik

(the weird stack trace showing an XML parsing error is due to Solr
trying to continue on to the next document even though the first had
an error... and it looks like this part of the code could use a little
work).


Re: What is proper way to re-init index?

Posted by Yonik Seeley <ys...@gmail.com>.
Hi John,

The error message "undefined field form" means Solr doesn't know about
the "form" field.
Did you copy your schema.xml to the example/solrconf directory and
restart the app server?

I tried your schema and doc, and didn't get the error you did.  I got
an error further down due to and invalid date format (see schema.xml
comments for date type for the correct format).

-Yonik

(the weird stack trace showing an XML parsing error is due to Solr
trying to continue on to the next document even though the first had
an error... and it looks like this part of the code could use a little
work).

RE: What is proper way to re-init index?

Posted by John Mohr <jt...@healthconresources.com>.
The problem script, schema.xml file and exception are in the attached file.

RE: What is proper way to re-init index?

Posted by Chris Hostetter <ho...@fucit.org>.
: After some fiddling around the base problem is that it takes my new schema,
: implies that the update went fine, but it didn't. Of no great surprise, the
: problem is that the schema for some reason doesn't match my data. It doesn't
: write out any data. Reconfiging with the example (old) data (and old schema)
: it writes it out just fine. Hmmm. It seems that further investigation is

can you send a copy of your schema and and example of one "<add><doc>..."
file? ... we might be able to help spot the problem.



-Hoss


RE: What is proper way to re-init index?

Posted by John Mohr <jt...@healthconresources.com>.
After some fiddling around the base problem is that it takes my new schema,
implies that the update went fine, but it didn't. Of no great surprise, the
problem is that the schema for some reason doesn't match my data. It doesn't
write out any data. Reconfiging with the example (old) data (and old schema)
it writes it out just fine. Hmmm. It seems that further investigation is
warranted.

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org]
Sent: Friday, March 24, 2006 3:33 PM
To: solr-user@lucene.apache.org
Subject: Re: What is proper way to re-init index?


: index to be more of what I'd like to see, generated my own xml files to
: index, blew away the old index/directories, restarted with the new schema
: file and it only creates the index and segment directories but not the
: complete index. Luke tells me I have a corrupted index. What is the proper

I'm not sure about Luke saying the index is corrupted -- that may just be
because it's empty.  It sounds like you never re-indexed your data after
blowing away the old index.

did you re-index the XML documents you made after you deleted the index
directory? ... either using the post.sh script provided by the example, or
by using some other client to POST the documents?



-Hoss



Re: What is proper way to re-init index?

Posted by Chris Hostetter <ho...@fucit.org>.
: index to be more of what I'd like to see, generated my own xml files to
: index, blew away the old index/directories, restarted with the new schema
: file and it only creates the index and segment directories but not the
: complete index. Luke tells me I have a corrupted index. What is the proper

I'm not sure about Luke saying the index is corrupted -- that may just be
because it's empty.  It sounds like you never re-indexed your data after
blowing away the old index.

did you re-index the XML documents you made after you deleted the index
directory? ... either using the post.sh script provided by the example, or
by using some other client to POST the documents?



-Hoss


Re: What is proper way to re-init index?

Posted by Bill Au <bi...@gmail.com>.
If you don't care about saving any data, you can just remove the index
directory.
Solr will create a new one if it does not already exist.
You will need to repopulate your data.

Bill

On 3/24/06, John Mohr <jt...@healthconresources.com> wrote:
>
> I've been working with Solr for just a few days. Initially I ran the
> exampldocs and things worked fine. I've now redefined the layout of the
> index to be more of what I'd like to see, generated my own xml files to
> index, blew away the old index/directories, restarted with the new schema
> file and it only creates the index and segment directories but not the
> complete index. Luke tells me I have a corrupted index. What is the proper
> way to create the index? I can go back to the pre-expansion solr.war file
> but that seems a bit drastic.
>
>