简体   繁体   English

Google App Engine搜索:搜索结果中的HTML字段摘要

[英]Google App Engine Search: snippeted HTML field in search results

I can return a snippeted TextField field in the search results of the (experimental) Google App Engine Search API . 我可以在(实验性) Google App Engine Search API的搜索结果中返回一个简短的TextField字段。 But how can I return a snippeted HtmlField field? 但是,如何返回摘录的HtmlField字段? I tried this, but the HTML tags are not removed in the snippeted result. 我尝试了此操作,但是在摘录的结果中并未删除HTML标记。 Also, the dot at the end of a sentence is removed in the snippeted result. 此外,句子摘要中的句子末尾的点也将被删除。 I would like to present the snippeted results like the Google search results: without HTML tags, with a dot at the end of a sentence. 我想展示摘录的结果,例如Google搜索结果:不带HTML标记,在句子末尾加一个点。 Is it possible? 可能吗? Should I just have patience and wait for future releases? 我是否应该有耐心并等待将来的发布? That could take a long time. 这可能需要很长时间。 I use Python. 我使用Python。

Edit: Now I store a copy of the HTML content with the HTML tags removed in the index document, so that solves the HTML problem. 编辑:现在,我存储了HTML内容的副本,其中在索引文档中删除了HTML标记,从而解决了HTML问题。 But how can I display the punctuation in the snippeted field in the search results? 但是,如何在搜索结果的摘要字段中显示标点符号?

Apparently, there are some issues with the Search API on the development server. 显然,开发服务器上的Search API存在一些问题。 In production, punctuation and snippeted HTML field is shown as expected. 在生产中,标点和摘要HTML字段按预期显示。 Also, I think query results are cached somewhere on the development server. 另外,我认为查询结果缓存在开发服务器上的某个位置。

I guess these problems have to do with the Search API still being experimental. 我想这些问题与Search API仍处于试验阶段有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM