Using expressions/fields for Search API SortExpression default_value

51 views
Skip to first unread message

Bradley Mclain

unread,
Nov 15, 2016, 10:17:31 PM11/15/16
to Google App Engine Mailing List
search.SortExpression(
  expression="sort_field",
  direction=search.SortExpression.DESCENDING,
  default_value="
default_field"
)

In the event that sort_field is missing I would like it to use the value from default_field instead.

Is something like this possible?


Mihail Russu

unread,
Nov 16, 2016, 5:49:50 AM11/16/16
to Google App Engine
Isn't that already the default behavior per docs?

Bradley Mclain

unread,
Nov 16, 2016, 5:46:38 PM11/16/16
to Google App Engine Mailing List
From my testing it only appears to accept text/numeric values and passing it a field name will be interpreted as a string as opposed to the field value.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/9d54bd3b-2bda-4d4c-a54d-4895e9f1cc4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George (Cloud Platform Support)

unread,
Nov 21, 2016, 1:04:27 PM11/21/16
to Google App Engine
A field name is a string, so the default_value works as defined in the indicated document. If you would like to propose a new feature, in this case related to the behavior of the SortExpression class, opening a separate thread is more effective. Your posting should provide structured proposals, covering all aspects of the envisaged feature, including for instance the desired treatment of the field value, and all important detail. 
Reply all
Reply to author
Forward
0 new messages