5

The Situation

Alright, so we have our app in appengine with full text search activated. We had an index set on a document with a field named 'date'. This field is a DateField and now we changed the model of the document so the field 'date' is now a NumericField.

The problem is, on the production server, even if I cleared all the document from the index, the server responds with this type of error: Failed to parse search request ""; SortSpec numeric default value does not match expression type 'TEXT' in 'date'

The Solution

The problem is, "I think", the fact that the model on the server doesn't fit the model of the search query. So basically, one way to do it, would be to delete the whole index, but I don't know how to do it on the production server.

The dev server works flawlessly

David Dugué
  • 155
  • 2
  • 9

1 Answers1

7

If you empty out your index and call index.delete_schema() (index.deleteSchema() in Java) it will clear the mappings that we have from field name to type, and you can index your new documents as expected. Thanks!

Haldean Brown
  • 12,411
  • 5
  • 43
  • 58
  • Could you point me where you saw that in the docs or where I can find it in the source code? Maybe I don't have the good appengine version, which one are you using? – David Dugué Jan 20 '13 at 18:35
  • It's not in the docs; I work on the Search API team. I believe it was introduced in 1.7.3 (but it may have been 1.7.4). We're working on a way to make this a lot easier, but currently the `delete_schema` method is the only way to do it. It's in the API as a tool for fixing these sorts of issues. – Haldean Brown Jan 22 '13 at 00:16
  • 3
    In SDK 1.8.5 delete_schema gives a RuntimeError: CallNotFoundError('search.DeleteSchema does not exist',) – cat Oct 23 '13 at 16:03
  • 1
    Unfortunately, I haven't worked on the team for some time so I don't know what the equivalent call would be now. I would recommend filing a bug on the app engine bug tracker to get a response from the team. – Haldean Brown Oct 24 '13 at 16:40
  • Not sure about the old 1.8.5 version. However, I just tried it on the current version and it does work. Please file a bug on the external issue tracker if it doesn't work for you. – Alan Apr 22 '16 at 21:16