google app engine - GAE - Java - Best way to do a query filter "LIKE" -



in gae datastore have "person" entity name, surname , country

i need query "select * country name '%spa%'"

this answer offers solution this:

query query = new query("person"); query.addfilter("name", filteroperator.greater_than_or_equal, "pe"); query.addfilter("name", filteroperator.less_than, "pe"+ "\ufffd"); 

but don't have success, return 0 results... i'm missing something?

it seems alternative useing "search api", but... how migrate data of "persons" in datastore new document search?

any solutions?

thanks

that answer not same question. query provide prefix query: ie names start with "pe". seem want query names contain "pe" anywhere, not possible reasons explained in accepted answer question.

the search api indeed answer doing this, , details of how create documents represent datastore objects contained in link posted. (note isn't migration: data should stay in datastore, search api separate system used full-text search.)


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -