想要在客观化中进行自由文本搜索并做到与众不同,我的情况是这样的:
1) NamedTrivialNew class:
public class NamedTrivialNew implements Serializable {
private String title;
private String city;
...
}
public class KeyWord implements Serializable {
@Id
public Long id;
@Parent
public Key<NamedTrivialNew> reason;
public KeyWord(){
}
3)
Search filter class:
NamedTrivialNew n = new NamedTrivialNew();
n.setSomeString("search test");
KeyWord hp = new KeyWord();
hp.reason = Key.create(NamedTrivialNew.class, 123L);
hp.id = 456L;
Key<KeyWord> hpKey = ofy().save().entity(hp).now();
ofy().clear();
assert ofy().load().key(hpKey).now() != null;
QueryResultIterator<KeyWord> NamedTrivialNew = ofy().load().type(KeyWord.class).filter("keyword>=", "search").filter("keyword <=", "search\uFFFD").iterator();
我正在关注此示例:
https://groups.google.com/forum/#!topic/objectify-appengine/Uc6_f98Tuao
可导入的原因= ofy.query(Keyword.class).filter(“keyword
=“,”basic“)。filter(”keyword&lt; =“,”basic \ uFFFD“)。fetchParents();
没有方法:fetchParents();
我已尝试过以上样本,但它无效....