You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Gus Heck <gu...@gmail.com> on 2015/05/27 18:21:26 UTC

Hmm, bug?

So I did the following (seemingly) reasonable set of steps...


   1. Set up a Solr Cloud instance with mutable managed schema (data driven
   config)
   2. Tossed a couple docs in just to see it work.
   3. Tried to sort on 'title', realized title had been guessed as
   multivalued.
   4. Changed the field to type=string (as opposed to strings) using schema
   api
   5. Tried to sort on title

The result is

   -

   "trace": "java.lang.IllegalStateException: unexpected docvalues
type SORTED_SET for field 'title' (expected=SORTED). Use
UninvertingReader or index with docvalues.\n\tat
org.apache.lucene.index.DocValues.checkField(DocValues.java:208)

   - Resending the curl command to re-index the docs hangs

However, I have not played with schemaless or the schema api before, so
maybe I've missed something, and my steps are not reasonable, and thus this
sanity check before I file a bug.

-Gus

-- 
http://www.the111shift.com

Re: Hmm, bug?

Posted by Erick Erickson <er...@gmail.com>.
Problem here is that you changed the schema without completely
re-indexing. In fact, when changes like this are made I typically blow
away the entire data directory or delete/recreate the collection.

At the Lucene layer, there's no schema and certainly no going back to
update already closed segments because a schema changed. So things get
confused when trying to sort since multiple segments have different
definitions for the same field. The loose coupling between the schema
and what's already in the index from an older schema definition is one
of the things we learn to deal with.

In general, when doing much of anything to the schema except _adding_
fields, I recommend starting over completely. You can do this crudely
by stopping all your servers and deleting the data directory (as in
'rm -rf data) then restarting. Or, just use the collections API to
delete then re-add the collection.

Best,
Erick

On Wed, May 27, 2015 at 9:21 AM, Gus Heck <gu...@gmail.com> wrote:
> So I did the following (seemingly) reasonable set of steps...
>
> Set up a Solr Cloud instance with mutable managed schema (data driven
> config)
> Tossed a couple docs in just to see it work.
> Tried to sort on 'title', realized title had been guessed as multivalued.
> Changed the field to type=string (as opposed to strings) using schema api
> Tried to sort on title
>
> The result is
>
> "trace": "java.lang.IllegalStateException: unexpected docvalues type
> SORTED_SET for field 'title' (expected=SORTED). Use UninvertingReader or
> index with docvalues.\n\tat
> org.apache.lucene.index.DocValues.checkField(DocValues.java:208)
>
> Resending the curl command to re-index the docs hangs
>
> However, I have not played with schemaless or the schema api before, so
> maybe I've missed something, and my steps are not reasonable, and thus this
> sanity check before I file a bug.
>
> -Gus
>
> --
> http://www.the111shift.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org