Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

couchdb-lucene on windows #172

Closed
lisir opened this Issue Apr 23, 2013 · 16 comments

Comments

Projects
None yet
2 participants

lisir commented Apr 23, 2013

my couchdb local.ini is:
[couchdb]
os_process_timeout=60000 ; increase the timeout from 5 seconds.

[external]
fti=C:/Python25/python.exe D:/aming/couchdb-lucene-0.10.0-SNAPSHOT/tools/couchdb-external-hook.py

[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}

when I brower http://10.68.199.151:5984/test/_fti/_design/foo/by_name?q=hello
have error

[error] [<0.131.0>] Uncaught server error: {{bad_return_value,
{os_process_error,
{exit_status,1}}},
{gen_server,call,
[<0.169.0>,
{execute,
{[{<<"info">>,
{[{db_name,<<"test">>},
{doc_count,2},
{doc_del_count,0},
{update_seq,3},
{purge_seq,0},
{compact_running,false},
{disk_size,12383},
{data_size,638},
{instance_start_time,
<<"1366708574155002">>},
{disk_format_version,6},
{committed_update_seq,
3}]}},
{<<"id">>,null},
{<<"uuid">>,
<<"eaeb0e937bcbe119bacbdd2f46000074">>},
{<<"method">>,'GET'},
{<<"requested_path">>,
[<<"test">>,<<"_fti">>,
<<"_design">>,<<"foo">>,
<<"by_name?q=hello">>]},
{<<"path">>,
[<<"test">>,<<"_fti">>,
<<"_design">>,<<"foo">>,
<<"by_name">>]},
{<<"raw_path">>,
<<"/test/_fti/_design/foo/by_name?q=hello">>},
{<<"query">>,
{[{<<"q">>,<<"hello">>}]}},
{<<"headers">>,
{[{<<"Accept">>,
<<"text/html, application/xhtml+xml, /">>},
{<<"Accept-Encoding">>,
<<"gzip, deflate">>},
{<<"Accept-Language">>,
<<"zh-CN">>},
{<<"Authorization">>,
<<"Basic dfdf">>},
{<<"Connection">>,
<<"Keep-Alive">>},
{<<"Host">>,
<<"10.68.199.151:5984">>},
{<<"User-Agent">>,
<<"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)">>}]}},
{<<"body">>,undefined},
{<<"peer">>,
<<"10.68.7.128">>},
{<<"form">>,{[]}},
{<<"cookie">>,{[]}},
{<<"userCtx">>,
{[{<<"db">>,<<"test">>},
{<<"name">>,<<"admin">>},
{<<"roles">>,
[<<"_admin">>]}]}},
{<<"secObj">>,{[]}}]}},
infinity]}}
[info] [<0.131.0>] 10.68.7.128 - - GET /test/_fti/_design/foo/by_name?q=hello 500
1>

Owner

rnewson commented Apr 23, 2013

Does "C:/Python25/python.exe D:/aming/couchdb-lucene-0.10.0-SNAPSHOT/tools/couchdb-external-hook.py" work from a command prompt?

Owner

rnewson commented Apr 23, 2013

Also, what version of CouchDB are you using?

lisir commented Apr 23, 2013

couchdb 1.2.0,python 3.3.1
[external] I am in your document configuration,
C:/Python25/python.exe is my python installation path.
Yes?

lisir commented Apr 23, 2013

The main error is:
[info] [<0.176.0>] COMMAND: py C:/couchdb-lucene/tools/couchdb-external-hook.py
[error] [<0.176.0>] OS Process Error <0.177.0> :: {os_process_error,
{exit_status,1}}
[error] [<0.176.0>] ** Generic server <0.176.0> terminating

Owner

rnewson commented Apr 23, 2013

Hi,

Since you have CouchDB 1.2.0 you don't need the Python script at all.

Read the section in the README (https://github.com/rnewson/couchdb-lucene/blob/master/README.md) called "Proxy handler (for CouchDB versions from 1.1 onward)".

B.

Owner

rnewson commented Apr 23, 2013

"local" refers to a key in couchdb-lucene's ini file, it tells couchdb-lucene where couchdb is. It's a little used feature but you can configure couchdb-lucene to know about multiple different couchdb servers. The default is called "local" and just points to localhost:5984.

Did you successfully query?

lisir commented Apr 23, 2013

my couchdb local.ini is:
[couchdb]
os_process_timeout=60000 ; increase the timeout from 5 seconds.
[httpd_global_handlers]
_fti = {couch_httpd_proxy, handle_proxy_req, <<"http://localhost:5895">>}

when I browse:
http://10.68.199.151:5984/_fti/local/test/_design/foo/by_name
has the 500 error

lisir commented Apr 23, 2013

when I browse:
http://10.68.199.151:5984/_fti/local/test/_design/foo/by_name
The index folder has index file,but the page has 404
why?

Owner

rnewson commented Apr 23, 2013

hi, can you show the 500 error you are getting? Can you show what 'curl localhost:5985' returns?

lisir commented Apr 23, 2013

Add index is ok.
Does the query view is the same as before?
I creat a view as:
"_id": "_design/application",
"views": {
"viewname": {
"map": "function(doc){emit(doc.name,doc)}"
}
but when I browse query:
http://10.68.199.151:5984/_fti/local/test/_design/application/viewname?p=name:test
has 404 error.

lisir commented Apr 23, 2013

when I add Index has error:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:113)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:130)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:127)
at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:147)
at org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:211)
at org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:183)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:152)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
at org.apache.http.impl.io.ChunkedInputStream.exhaustInputStream(ChunkedInputStream.java:277)
at org.apache.http.impl.io.ChunkedInputStream.close(ChunkedInputStream.java:261)
at org.apache.http.entity.BasicHttpEntity.consumeContent(BasicHttpEntity.java:142)
at org.apache.http.conn.BasicManagedEntity.consumeContent(BasicManagedEntity.java:98)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:740)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:709)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:700)
at com.github.rnewson.couchdb.lucene.DatabaseIndexer.run(DatabaseIndexer.java:490)
at java.lang.Thread.run(Thread.java:619)

Owner

rnewson commented Apr 23, 2013

Hi,

Aha, I see. Couchdb-lucene uses the "fulltext" top-level key not the "views" top-level key. The README file (https://github.com/rnewson/couchdb-lucene) contains examples.

B.

lisir commented Apr 23, 2013

like this:
{
"_id": "_design/application",
"fulltext": {
"viewname": {
"index": "function(doc){return doc;)}"
}
}
}

http://10.68.199.151:5984/_fti/local/test/_design/application/viewname?p=name:test

but has error,why?Can you give me a instance.

lisir commented Apr 23, 2013

Add indexing and query with a same "fulltext" top-level key?

Owner

rnewson commented Apr 23, 2013

Hi,

This is covered in the README https://github.com/rnewson/couchdb-lucene, see "Document Indexing".

B.

@rnewson rnewson closed this Apr 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment