Search API, how to like query

2.1k views Asked by At

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

There are 1 answers

2
Ashish Awasthi On BEST ANSWER

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