All Projects → potatolondon → Search

potatolondon / Search

Licence: mit
A wrapper around Google's full text search API for App Engine

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Search

Djangae
The best way to run Django on Google Cloud. This project is now on GitLab: https://gitlab.com/potato-oss/djangae/djangae
Stars: ✭ 576 (+1007.69%)
Mutual labels:  appengine, library
Search Engine Parser
Lightweight package to query popular search engines and scrape for result titles, links and descriptions
Stars: ✭ 216 (+315.38%)
Mutual labels:  search, library
Smartmaterialspinner
The powerful android spinner library for your application
Stars: ✭ 108 (+107.69%)
Mutual labels:  search, library
Lara Eye
Filter your Query\Builder using a structured query language
Stars: ✭ 39 (-25%)
Mutual labels:  search, library
Thmap
Concurrent trie-hash map library
Stars: ✭ 51 (-1.92%)
Mutual labels:  library
Typescript Lib Example
Example of TypeScript library setup for multiple compilation targets using tsc and webpack
Stars: ✭ 50 (-3.85%)
Mutual labels:  library
Libgit2
A cross-platform, linkable library implementation of Git that you can use in your application.
Stars: ✭ 8,208 (+15684.62%)
Mutual labels:  library
Cordova App Harness
[DEPRECATED] Apache Cordova app harness
Stars: ✭ 49 (-5.77%)
Mutual labels:  library
Alchemlyb
the simple alchemistry library
Stars: ✭ 52 (+0%)
Mutual labels:  library
Hadotnet
🏡 A .NET Standard library for Home Assistant.
Stars: ✭ 52 (+0%)
Mutual labels:  library
Lingua Franca
Mycroft's multilingual text parsing and formatting library
Stars: ✭ 51 (-1.92%)
Mutual labels:  library
Libcon.ahk
LibCon - AutoHotkey Library For Console Support
Stars: ✭ 50 (-3.85%)
Mutual labels:  library
Vim Lookup
Jump to the definition of variables or functions in VimL code.
Stars: ✭ 51 (-1.92%)
Mutual labels:  search
Kotlin Link Parser
Link preview for android
Stars: ✭ 50 (-3.85%)
Mutual labels:  library
Mindo
Generate mind maps easily in your android app.
Stars: ✭ 52 (+0%)
Mutual labels:  library
Thirtyinch
a MVP library for Android favoring a stateful Presenter
Stars: ✭ 1,052 (+1923.08%)
Mutual labels:  library
Faboptions
A multi-functional FAB component with customizable options
Stars: ✭ 1,060 (+1938.46%)
Mutual labels:  library
Vrac
Declarative html template library from the future. <wip>
Stars: ✭ 52 (+0%)
Mutual labels:  library
Long Shadows
Long Shadows for android!
Stars: ✭ 1,059 (+1936.54%)
Mutual labels:  library
Siler
⚡ Flat-files and plain-old PHP functions rockin'on as a set of general purpose high-level abstractions.
Stars: ✭ 1,056 (+1930.77%)
Mutual labels:  library

Search (Thor)

Thor (search) is a wrapper for Google App Engine's search API that uses Django-like syntax for defining documents, and searching and filtering search indexes.

Example

Searching films

Say your app has a database of films that needs to be searched. The first step is to define a document class describing the searchable film data:

from search import indexes, fields

class FilmDocument(indexes.DocumentModel):
    title = fields.TextField()
    description = fields.TextField()
    rating = fields.FloatField()
    released = fields.DateField()

To index a film document, instantiate and populate it with data, and then add it to Thor's provided Index class. It's more likely the data would come from some other source (datastore, database, etc.) but for this example we hand-craft it:

>>> from datetime import date
>>> from search import indexes
>>> from myapp.documents import FilmDocument
>>>
>>> # This gets a search index by name or creates it if it doesn't exist
>>> i = indexes.Index(name='films')
>>> # Create a film document representing the film Die Hard
>>> doc = FilmDocument(
...     doc_id='die-hard',
...     title='Die Hard',
...     description='The most awesome film ever',
...     rating=9.7,
...     released=date(1989, 2, 3)
... )
>>> # Add the document to the index. In reality this should be done on
>>> # a taskqueue at a rate around 4 docs/sec.
>>> i.put(doc)

Now the document has been indexed and is ready to search:

>>> # You need to pass the document class (FilmDocument here) to the
>>> # index's search method so that it knows what class to instantiate
>>> # with the search results
>>> results = i.search(FilmDocument).keywords('die hard awesome')
>>> for d in results:
...     print d.title, d.description, d.rating, d.released
...
'Die Hard', 'The most awesome film ever', 9.7, datetime.date(1989, 2, 3)

From a basic standpoint, that's all there is to it. There is various filtering and ordering that can be applied to search queries, refer to the reference for the Index class for more in-depth example queries.

Reference

See here for WIP docs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].