如何删除或重置Appengine中的搜索索引 [英] How to delete or reset a search index in Appengine

查看:69
本文介绍了如何删除或重置Appengine中的搜索索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我们的应用程序在appengine中激活了全文搜索。我们在一个名为'date'的字段上设置了一个索引集。这个字段是一个DateField,现在我们改变了文档的模型,所以字段'date'现在是一个NumericField。

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.

问题是,在生产服务器上,即使我从索引中清除了所有文档,服务器也会回应这种类型的错误:无法解析搜索请求 ; SortSpec数字默认值与'date'中的表达式类型'TEXT'不匹配

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

推荐答案

如果您清空索引并调用 index.delete_schema() index.deleteSchema()),它将清除我们从字段名到类型的映射,并且可以按照预期为新文档建立索引。谢谢!

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!

这篇关于如何删除或重置Appengine中的搜索索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆