Siena 2.0.7 search method not working properly in Play 1.2.5!

50 views
Skip to first unread message

Antonio de Sousa Barroso

unread,
Nov 2, 2012, 6:43:11 AM11/2/12
to siena-...@googlegroups.com
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

Pascal Voitot Dev

unread,
Nov 2, 2012, 5:10:04 PM11/2/12
to siena-...@googlegroups.com
I confirm the limitations of search due to limitations of GAE mainly.
Search in GAE is actually a hack.
I don't know if GAE has released its GAE search feature but if yes, it would be better than this hack!

regards
Pascal


--
You received this message because you are subscribed to the Google Groups "Siena" group.
To view this discussion on the web visit https://groups.google.com/d/msg/siena-discuss/-/uDYUzHSZnPoJ.
To post to this group, send email to siena-...@googlegroups.com.
To unsubscribe from this group, send email to siena-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siena-discuss?hl=en.

Antonio de Sousa Barroso

unread,
Nov 4, 2012, 1:24:19 PM11/4/12
to siena-...@googlegroups.com
Thanks Pascal, 

but the word LIMITATIONS is somewhat short.

Are there any alternatives to this?  Maybe change to Amazon?

Thanks 
Antonio
Reply all
Reply to author
Forward
0 new messages