Hi,
I'm implementing an REST service with Play 1.2.5 and Siena 2.0.7 (deploy to GAE) but when I try to use search method it doesn't work properly. I have an special field in each model (index) in which replaced special characters and spaces with standard characters (for example, the space by _). Bearing in mind the following rules which have worked for me in previous versions of Siena:
Siena ALLOWS the following searches for GAE (for the time being):
-search on 1 field and no more: all().fetch() .search("the_string_to_search",_"the_field_to_search")
-search on field equaling one precise string: all() .fetch ().search("myString",_"the_field_to_search")
-search on field equaling several precise strings (like a OR): all () .fetch () .search("myString1_myString2",_"the_field_to_search")
-search on field beginning with a string: all() .fetch().search("myString*",_"the_field_to_search")
Siena DOESN't ALLOW the following searches for GAE:
-search on several fields: all() .fetch() .search("mystring",_"field1",_"field2")
-search on field ending with a string: all() .fetch() .search("*myString",_"the_field_to_search")
The method implementation:
public static List<SportType> searchByName(String name, int page, int rowsPerPage) {
return SportType.all()
.search(
Utils.index(name) + "*",
"index"
)
.fetch(rowsPerPage, (page - 1) * rowsPerPage);
}
I don't know what is going on or what I'm doing wrong, or what has changed in Siena 2.0.7. I didn't use Play 2.0 for the time that it would take to acquire knowledge, but in the end I have lost much more in details like this, that supposedly worked in previous versions.
Thanks,
Antonio