Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete or reset a search index in Appengine

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

like image 665
David Dugué Avatar asked Jan 17 '13 21:01

David Dugué


1 Answers

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!

like image 105
Haldean Brown Avatar answered Sep 28 '22 08:09

Haldean Brown