2017-06-05 99 views
1

下面的代码:GAE Python的搜索API不工作

from google.appengine.api import search 
index = search.Index(name='members') 
document = search.Document(
    fields=[ 
     search.TextField(name='full_name', value='sample text') 
    ])  
index.put(document) 
results = index.search('full_name:tex') 
logging.info(results) 

回报:

search.SearchResults(number_found=0L) 

我在做什么错?

回答

0

找到了答案。看起来GAE Search API是全文搜索,不支持部分匹配。基于这个答案的Tokenized数据在这里: Partial matching GAE search API