Java Search API on DataStore

117 views
Skip to first unread message

Raunak Gupta

unread,
May 30, 2016, 6:40:23 PM5/30/16
to Google App Engine
I'm slightly confused - can the Java Search API (for full text search) be used on Google Cloud DataStore, do so I need to use a different storage option? If I can, do I use the Objectify library, or is there a different library I should use?

- Raunak

Anastasios Hatzis

unread,
May 31, 2016, 7:35:47 AM5/31/16
to google-a...@googlegroups.com
I don't know if the Objectify library supports Search API documents., but Search API and Datastore are two different services, although it can be very useful to combine them.

Search API allows your app to define a search index (for example: "BlogComments"), and then insert search documents to the index, where each document consists of fields such as "authorName", "topic", "body" etc. Then your app can search the index for documents that match the search query (e.g. all comments with a certain word in "body").

Typically, the search documents only reflect data that is stored somewhere else, e.g. as entities in Datastore, because you want to apply advanced text search features that are not available in the original storage. For example, in Datastore you can not perform queries for partial strings. Or querying files in Google Cloud Storage through the API is only rudimentary.


On 31 May 2016 at 00:40, Raunak Gupta <rauna...@gmail.com> wrote:
I'm slightly confused - can the Java Search API (for full text search) be used on Google Cloud DataStore, do so I need to use a different storage option? If I can, do I use the Objectify library, or is there a different library I should use?

- Raunak

--
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-appengi...@googlegroups.com.
To post to this group, send email to google-a...@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/11fc5f40-b0e9-471d-9cf1-680810212f0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Mit freundlichen Grüßen / Kind regards

i. A.
Anastasios Hatzis

Fon: +49 8374 930813
Fax: +49 8374 930810
Mobil: +49 1520 8592878

HATZIS Edelstahlbearbeitung GmbH
Hojen 2
87490 Haldenwang (Allgäu)
Germany

Handelsregister Kempten (Allgäu): HRB 4204
Geschäftsführer: Paulos Hatzis, Charalampos Hatzis
Umsatzsteuer-Identifikationsnummer: DE 128791802
GLN: 42 504331 0000 6

http://www.hatzis.de/

Nick

unread,
May 31, 2016, 6:36:05 PM5/31/16
to Google App Engine
Search and datastore are distinct. You will need to create a document in the search API for anything you want to search for, even if stored in the datastore. Objectify doesn't deal with search at all.

The thundr GAE module provides a DAO/repository abstraction that coordinates search and ofy writes and searches, I don't know of any other Java based search abstraction.

I would recommend investigating the search APIs limitations before investing heavily in integrating it - it may be less comprehensive than you might assume.

Main limitations are:
Only uses dates (not times)
Can't store longs naturally
Only provides basic stemming
Numeric comparisons can exhibit slightly odd behavior for very near values
Geo search doesn't work in devserver
Consistency constraints are basically undefined


You may be better served based on your requirement to look at elastic search or similar on GCE/GKE/Saas

Raunak Gupta

unread,
Jun 1, 2016, 7:28:40 AM6/1/16
to Google App Engine
I was mainly looking to provide AutoComplete functionality, but it seems to me I might be better off using Algolia or ElasticSearch instead. 

Nick

unread,
Jun 1, 2016, 5:56:53 PM6/1/16
to Google App Engine
If you want autocomplete from the start of the word/phrase you can do that with the datastore alone and a basic string query.

If you want it from mid phrase, neither datastore or search API are particularly great at this (you need to store all fragments yourself)

Algolia will have you up and running in no time, and it's crazy fast

Reply all
Reply to author
Forward
0 new messages