test it but not work, steps:
1 download, extract and run solr-7.0.0

2 install solrpy
easy_install solrpy

3 run and create new web2py app 2.14.6
*models/db.py*
import solr 
s = solr.SolrConnection('http://localhost:8983/solr') 

*controllers/default.py*
def test():
form = SQLFORM.factory(Field('body') ) 
if form.accepts(request.vars): 
s.add(body = request.vars.body) 
s.commit() 
return locals()

*views/default/test.html*
{{extend 'layout.html'}}
{{=form}}

*browser for web2py*
https://localhost:8000/test/default/test
*browser for solr*
status solr is running and can be accessed from web 
: http://localhost:8983/solr

*after submit an error occured:*

Traceback (most recent call last):
  File "/home/site/web2py/gluon/restricted.py", line 227, in restricted
    exec ccode in environment
  File "/home/site/web2py/applications/solr/controllers/default.py" 
<https://192.168.1.80/admin/default/edit/solr/controllers/default.py>, line 68, 
in <module>
  File "/home/site/web2py/gluon/globals.py", line 417, in <lambda>
    self._caller = lambda f: f()
  File "/home/site/web2py/applications/solr/controllers/default.py" 
<https://192.168.1.80/admin/default/edit/solr/controllers/default.py>, line 64, 
in test
    s.add(body = request.vars.body)
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 679, in add
    return Solr.add_many(self, [fields], commit=_commit)
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 326, in wrapper
    return self._update(content, query)
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 551, in _update
    rsp = self._post(selector, request, self.xmlheaders)
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 640, in _post
    return check_response_status(self.conn.getresponse())
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 1103, in 
check_response_status
    raise ex
SolrException: HTTP code=404, reason=Not Found


best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to