2
votes

I'm using the Search API GAE, how to make a query like "like%"? as is done in SQL example: select * from person where name like '% john%';

1
what do you want exactly please explain it . - syed shah
I want to do a search using the search service (Search API) like this in SQL: select * from name like '% jo%'; (return john) - Joander Vieira Cândido

1 Answers

1
votes

your queryString would be "name: john" on the person index with name field set to be a Text field.

A regular query with ':' or '=' on the Text or HTML type of index value is closest (not same) to 'like' in SQL.

Details on available operators to use in the query are at https://developers.google.com/appengine/docs/java/search/query_strings#Java_Queries_on_text_and_HTML_fields.

Also check stemming if your use-case is to find words with similar meaning. https://developers.google.com/appengine/docs/java/search/query_strings#Java_Stemming