The Web2py database abstraction layer does not support SOLR at this time, which means that you cannot use the DAL syntax to access SOLR, and you cannot use automatically generated forms from the SOLR DB schema. However, you can create forms using SQLFORM.factory as if you had a normal relational database and manually insert / update / select / update SOLR. web2py includes libraries for parsing / writing both JSON and XMl, so it will be easy to implement the SOLR API in a few lines of code. If you put this on the web2py mailing list, we can help with some examples.
EDIT (copied from response to web2py mailing list):
Usually in web2py you define a model
db.define_table('message',Field('body'))
and then web2py generates and processes the forms for you:
form=SQLFORM(db.message) if form.accepts(request.vars): do_something
In your case, you will not use define_table, since web2py DAL does not support SOLR, and you cannot create forms from a schema, but you can set this: http://code.google.com/p/solrpy/ and you can do
#in model import solr s = solr.SolrConnection('http://example.org:8083/solr')
So the difference is in SQLFORM.factory instead of SQLFORM and an extra line after adoption. That's all.
source share