All Projects → SurveyMonkey → Wukong

SurveyMonkey / Wukong

Licence: mit
An ORM Client library for SolrCloud http://wukong.readthedocs.io/en/latest/

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Wukong

Movement
Movement is an easier, simpler way to explore and use NIEM. Want to join the Movement and contribute to it? Start here.
Stars: ✭ 19 (+90%)
Mutual labels:  solr
Php Es Mapper
An elasticsearch simple mapping ORM for php
Stars: ✭ 25 (+150%)
Mutual labels:  orm
Pims
An ORM for document-oriented database systems, written in and for TypeScript.
Stars: ✭ 9 (-10%)
Mutual labels:  orm
Framework
High-Performance Long-Living PHP Framework for modern enterprise application development
Stars: ✭ 895 (+8850%)
Mutual labels:  orm
Swoft Db
[READ ONLY] Database Compoment for Swoft
Stars: ✭ 25 (+150%)
Mutual labels:  orm
Walrus
Lightweight Python utilities for working with Redis
Stars: ✭ 846 (+8360%)
Mutual labels:  orm
Gravity
ORM Framework for Relativity Custom Development
Stars: ✭ 17 (+70%)
Mutual labels:  orm
Js Data Mongodb
MongoDB adapter for js-data. Main Site: http://js-data.io, API Reference Docs: http://api.js-data.io
Stars: ✭ 9 (-10%)
Mutual labels:  orm
Joomla Entity
Semantical API for Joomla!
Stars: ✭ 25 (+150%)
Mutual labels:  orm
Ktorm
A lightweight ORM framework for Kotlin with strong-typed SQL DSL and sequence APIs.
Stars: ✭ 843 (+8330%)
Mutual labels:  orm
Queryablelist
Python module to add support for ORM-style filtering to any list of items
Stars: ✭ 19 (+90%)
Mutual labels:  orm
Eloquent Filter
This simple package helps you filter Eloquent data using query filters.
Stars: ✭ 24 (+140%)
Mutual labels:  orm
Dockerfiles
50+ DockerHub public images for Docker & Kubernetes - Hadoop, Kafka, ZooKeeper, HBase, Cassandra, Solr, SolrCloud, Presto, Apache Drill, Nifi, Spark, Consul, Riak, TeamCity and DevOps tools built on the major Linux distros: Alpine, CentOS, Debian, Fedora, Ubuntu
Stars: ✭ 847 (+8370%)
Mutual labels:  solr
Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+8850%)
Mutual labels:  orm
Go Kallax
Kallax is a PostgreSQL typesafe ORM for the Go language.
Stars: ✭ 853 (+8430%)
Mutual labels:  orm
Relevancyfeedback
Dice.com's relevancy feedback solr plugin created by Simon Hughes (Dice). Contains request handlers for doing MLT style recommendations, conceptual search, semantic search and personalized search
Stars: ✭ 19 (+90%)
Mutual labels:  solr
Untech.sharepoint
Untech.SharePoint - library that will improve your work with Lists in SharePoint (can be used with SSOM and CSOM)
Stars: ✭ 8 (-20%)
Mutual labels:  orm
Storm React Native
⚛️⚡️ AsyncStorage manager library for React Native
Stars: ✭ 10 (+0%)
Mutual labels:  orm
Solrnet
Solr client for .Net
Stars: ✭ 853 (+8430%)
Mutual labels:  solr
Solarium
PHP Solr client library
Stars: ✭ 849 (+8390%)
Mutual labels:  solr

Wukong

Latest Version Travis CI Build Status Coveralls Coverage Status

Wukong offers an ORM query engine for Solr and Solr Cloud.

Installation

	pip install wukong

Usage

Create Solr Collection

Before you use wukong, make sure you already created your collection on SolrCloud. For example,

	curl http://localhost:8080/solr/admin/collections?action=CREATE&name=users&numShards=1&replicationFactor=2

A sample schema can be like:

<fields>
	<uniqueKey>id</uniqueKey>
  	<field name="id" type="int" indexed="true" stored="true" required="true" />
	<field name="name" type="string" indexed="true" stored="true" required="true"/>
	<field name="city" type="string" indexed="true" stored="true"/>
	<field name="age" type="int" indexed="true" stored="true"/>
	...
</fields>

Create a model class for Solr collection

Create a class for your Solr collection by extending the class SolrDoc. For example,

from wukong.models import SolrDoc

class User(SolrDoc):
    collection_name = "users"
    solr_hosts = "localhost:8080,localhost:8081"

    def validate_schema_fields(self, fields):
    	pass

    def get_data_for_solr(self):
    	pass

You can overide existing methods to fit your business logic, like validate_schema_fields, get_data_for_solr.

Use Solr QueryManger

Creat a document

User.documents.create(User_id=12345, name="Test Name", city="Test City")

Update a document

User.documents.update(User_id=12345, name="Test Name")

To index a batch of documentsto your Solr collection, use the container class: SolrDocs. Instead of accessing SOLR multiple times, it only issues one request to SOLR, which is more efficient.

	docs = [
		User(User_id=12345, name="Test Name1", city="Test Cit1"),
		User(User_id=123456, name="Test Name2", city="Test City2")
		...
	]
	docs = SolrDocs(docs)
	docs.index()

Fetch a document

User.documents.get(User_id__eq=12345)

Fetch multiple documents

User.documents.filter(name__eq="Test Name", city__wc="Test*").all()

Use compounded logic

User.documents.filter(OR(city__wc="Test*", name__eq="Test Name"))

Sort by a field

User.documents.sort_by("-name").all()

Force only return a certain fields

User.documents.only("is", "name").all()

Force only return the top 10 documents

User.documents.limit(10).all()

Chain the query methods

User.documents.filter(city__wc="Test*").sort_by("-name").limit(10).all()

Delete a document

User.documents.get(User_id__eq=12345).delete()

Batch delete documents

User.documents.filter(name__eq="Test Name").all().delete()

Documentations

Detailed docs can be found at http://wukong.readthedocs.io/en/latest/

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