All Projects → hhatto → poyonga

hhatto / poyonga

Licence: MIT license
Python Groonga Client

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to poyonga

Srchx
A standalone lightweight full-text search engine built on top of blevesearch and Go with multiple storage (scorch, boltdb, leveldb, badger)
Stars: ✭ 118 (+521.05%)
Mutual labels:  full-text-search
Library-Spring
The library web application where you can borrow books. It's Spring MVC and Hibernate project.
Stars: ✭ 73 (+284.21%)
Mutual labels:  full-text-search
CodeIndex
A Code Index Searching Tools Based On Lucene.Net
Stars: ✭ 28 (+47.37%)
Mutual labels:  full-text-search
Laravel Scout Postgres
PostgreSQL Full Text Search Engine for Laravel Scout
Stars: ✭ 140 (+636.84%)
Mutual labels:  full-text-search
Scout
RESTful search server written in Python, powered by SQLite.
Stars: ✭ 213 (+1021.05%)
Mutual labels:  full-text-search
understand-full-text-search
📖 Support examples for learning full-text search with use of PostgreSQL. Ready to run.
Stars: ✭ 98 (+415.79%)
Mutual labels:  full-text-search
Elman
Full text searching Linux man pages with Elasticsearch 🐧
Stars: ✭ 103 (+442.11%)
Mutual labels:  full-text-search
wink-bm25-text-search
Fast Full Text Search based on BM25
Stars: ✭ 44 (+131.58%)
Mutual labels:  full-text-search
Ftserver
Lightweight Embeddable iBoxDB Full Text Search Server for Java
Stars: ✭ 219 (+1052.63%)
Mutual labels:  full-text-search
fts
🔍 Postgres full-text search (fts)
Stars: ✭ 28 (+47.37%)
Mutual labels:  full-text-search
Everywhere
🔧 A tool can really search everywhere for you.
Stars: ✭ 147 (+673.68%)
Mutual labels:  full-text-search
Tntsearch
A fully featured full text search engine written in PHP
Stars: ✭ 2,693 (+14073.68%)
Mutual labels:  full-text-search
djangoqueries
The code of "Making queries" in docs.djangoproject.com that I used in my article "Full-Text Search in Django with PostgreSQL".
Stars: ✭ 39 (+105.26%)
Mutual labels:  full-text-search
Riddle
Ruby Client API for Sphinx
Stars: ✭ 139 (+631.58%)
Mutual labels:  full-text-search
mxusearch
🔍 基于讯搜封装的 Laravel 全文检索服务。
Stars: ✭ 40 (+110.53%)
Mutual labels:  full-text-search
Radon
RadonDB is an open source, cloud-native MySQL database for building global, scalable cloud services
Stars: ✭ 1,584 (+8236.84%)
Mutual labels:  full-text-search
bulksearch
Lightweight and read-write optimized full text search library.
Stars: ✭ 108 (+468.42%)
Mutual labels:  full-text-search
paperless-ng
A supercharged version of paperless: scan, index and archive all your physical documents
Stars: ✭ 4,840 (+25373.68%)
Mutual labels:  full-text-search
pg-search-sequelize
Postgres full-text search in Node.js and Sequelize.
Stars: ✭ 31 (+63.16%)
Mutual labels:  full-text-search
lunr-module
Full-text search with pre-build indexes for Nuxt.js using lunr.js
Stars: ✭ 45 (+136.84%)
Mutual labels:  full-text-search

poyonga

PyPI Version Build status

Python Groonga Client. poyonga support to HTTP and GQTP protocol.

Requrements

  • Python 3.6+

Installation

from pip:

pip install --upgrade poyonga

Usage

Setup Groonga Server

$ groonga -n grn.db     # create groonga database file
$ groonga -s grn.db     # start groonga server with GQTP

Basic Usage

>>> from poyonga import Groonga
>>> g = Groonga()
>>> g.protocol
'http'
>>> ret = g.call("status")
>>> ret
<poyonga.result.GroongaResult object at 0x8505ccc>
>>> ret.status
0
>>> ret.body
{u'uptime': 427, u'max_command_version': 2, u'n_queries': 3,
u'cache_hit_rate': 66.6666666666667, u'version': u'1.2.8', u
'alloc_count': 156, u'command_version': 1, u'starttime': 132
8286909, u'default_command_version': 1}
>>>

with eventlet

from poyonga import Groonga
import eventlet

eventlet.monkey_patch()

def fetch(cmd, **kwargs):
    g = Groonga()
    ret = g.call(cmd, **kwargs)
    print ret.status
    print ret.body
    print "*" * 40

cmds = [("status", {}),
        ("log_level", {"level": "warning"}),
        ("table_list", {})
        ("select", {"table": "Site"})]
pool = eventlet.GreenPool()
for cmd, kwargs in cmds:
    pool.spawn_n(fetch, cmd, **kwargs)
pool.waitall()

Custom prefix path

If you use the Custom prefix path and Multi databases , specify prefix_path .

# default is '/d/'
g = Groonga(prefix_path='/db2/')

with Apache Arrow

Groonga supports Apache Arrow, use it with load and select commands.

use poyonga with Apache Arrow, you need pyarrow .

requrie pyarrow:

$ pip install pyarrow

and call with output_type="apache-arrow" option:

from poyonga import Groonga

g = Groonga()
g.call(
    "select",
    table="Users",
    match_columns="name,location_str,description",
    query="東京",
    output_type="apache-arrow",
    output_columns="_key,name",
)

load with input_type="apache-arrow":

import pyarrow as pa
from poyonga import Groonga

# use Apache Arrow IPC Streaming Format
data = [pa.array(["groonga.org"])]
batch = pa.record_batch(data, names=["_key"])
sink = pa.BufferOutputStream()
with pa.ipc.new_stream(sink, batch.schema) as writer:
    writer.write_batch(batch)
buf = sink.getvalue()
values = buf.to_pybytes()

g = Groonga()
g.call("load", table="Site", values=values, input_type="apache-arrow")

more information:

example code

see examples directory

Links

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].