Full text search with google engine using ndb models

I created a google application using the following db (ndb) module to create my models. Now the problem is that I want to expand the search in the fields of these models, and I found two modules for this: 1. Officially comes with the Google engine (appengine / google / ext / search) and 2. gae text search (http: / /code.google.com/p/gae-text-search/). Both provide a search model for the old db module properties. Is there a way to do full-text search with ndb and google app engine 1.6.2. I also want to save these searches in the data warehouse, how can I achieve this? I am using python 2.7 for my development. Thanks in advance.

+4
source share
3 answers

The best solution is to wait for the full-text search in the application to complete. They are currently in the trusted testers phase, so soon. If you now refuse your own decision, you can complete it in a few months.

+1
source

C: https://cloud.google.com/appengine/docs/python/search/

The search API provides a model for indexing documents that contain structured data. You can search for an index, and organize and submit search results. The API supports full text matching across string fields. Documents and indexes are stored in a separate permanent storage optimized for search operations. The search API can index any number of documents.

Search execution:

index.search("rose water") 

Object Indexing:

 from datetime import datetime from google.appengine.api import search my_document = search.Document( fields=[ search.TextField(name='customer', value='Joe Jackson'), search.HtmlField(name='comment', value='this is <em>marked up</em> text'), search.NumberField(name='number_of_visits', value=7), search.DateField(name='last_visit', value=datetime.now()), search.DateField(name='birthday', value=datetime(year=1960, month=6, day=19)), search.GeoField(name='home_location', value=search.GeoPoint(37.619, -122.37)) ]) 
0
source

Source: https://habr.com/ru/post/1395904/


All Articles