2

Is it possible to have multiple fields with same name in Appengine Search service?

Why would i need this? An example if the document is a newspaper page and it consists of single news, I would create fields story, title, author. It would work great and i would be able to query documents with title:"something", author:"something else", but what when you have multiple stories on the same page? Multiple titles?

If i create fields with names "title1", "title2" .. i'm unable to search with the query title:"something"

If i put all titles in the same "title", when i search title, i'll get mixed results

If this is a stupid idea, or if this isn't possible, can someone recommend a better way to solve this?

4

1 回答 1

1

添加另一个对故事进行分组的字段。

基本上,您将为每个故事创建一个搜索文档,例如:

title, author, news_id
hi   ,    max,       1
hello,    max,       1
world,     me,       1
sup  ,     me,       2

然后你查询当你在新闻页面 1 中的 hi hello world stories 并希望 author max 。查询:作者:max 和 news_id:1 查询标题:标题:你好

所以你需要更多地打破你的搜索文档来做你想做的事。

于 2013-06-15T03:30:28.190 回答