Comments (9)
Ahhhh, now I see, after digging into some of the other issues I now get that with 2.x
you have to query couchdb-lucene
directly with something like:
curl http://localhost:5985/local/testDb/_design/search/by_title?q=title:captain
...with then gets me back...
{
"q": "title:captain",
"fetch_duration": 0,
"total_rows": 3,
"limit": 25,
"search_duration": 0,
"etag": "5633589417da1",
"skip": 0,
"rows": [
{
"score": 0.9384178519248962,
"id": "a32629854547e9e3b50bdd75fd00df8c",
"fields": {
"title": "Captain Hector Barbossa"
}
},
{
"score": 0.9384178519248962,
"id": "a32629854547e9e3b50bdd75fd00cff7",
"fields": {
"title": "Captain Jack Sparrow"
}
},
{
"score": 0.810458242893219,
"id": "a32629854547e9e3b50bdd75fd00ebff",
"fields": {
"title": "Captain John \"Calico Jack\" Rackham"
}
}
]
}
I think it could be well worth adding a note to the README to put this detail in an easier to find place, would have saved me a lot of time.
Still a very cool CouchDB addition. 👍
from couchdb-lucene.
@Crispy1975 Oh I typed error word in my view so that it didn't work, after I fixed, it works.
Thanks you so much!
from couchdb-lucene.
It was my bad that I had installed the earlier version of lucene and obviously it didn't work out. Sorry, and I'm providing the link here for the couch2.0 compatible lucene 2.0.0 version
https://github.com/rnewson/couchdb-lucene/releases/tag/v2.0.0
Thanks for all the help through the issues and comments
from couchdb-lucene.
@leforestier a PR would be welcomed. It's not so much that the url has changed, it's that you now have to call couchdb-lucene directly. the various schemes for proxying through http 2.0 no longer work.
from couchdb-lucene.
Thank Google, I found this thread. I was tearing my hairs out.
The README is downright wrong, actually. It states that the URL format is:
http://localhost:5984/_fti/local/dbname/_design/foo/view_name?q=field_name:value
Port 5984, of course, is the default port of CouchDB!!! I bet 9 out of 10 people would not know that we need to query Lucene directly when seeing 5984.
from couchdb-lucene.
Could you please send me your config?
I can't make it to work:
http://localhost:5985/local/databaseName/_design/posts/by_content?q=this
but it returns to me:
{"q":"","fetch_duration":0,"total_rows":0,"limit":25,"search_duration":0,"etag":"d4a463039c2","skip":0,"rows":[]}
from couchdb-lucene.
@huyentk happy to help... can you post the content of the view by_content
?
from couchdb-lucene.
@Crispy1975 : Thank you for the help with the curl that needs to be used for lucene in 2.0. I've tried and it seems none of the fields are getting indexed in my case.
An example doc:
{
"_id": "939ff7c2a8asfkj908wgsgdgggdgg",
"_rev": "1-1a5adca8b3c229esf8ste7sgs7ts",
"sex": "M",
"age": 55.8,
"subject_id": "fsfj35355",
"subject_comment": "This is a test user.",
"type": "subject"
}
{
"_id": "_design/foo",
"_rev": "6-1b45904c9ce4325d27049e10102a441e",
"fulltext": {
"by_subject": {
"index": "function(doc) {var ret=new Document();ret.add(doc.subject_id,{'field':'subject_id', 'store':'yes'}); ret.add(doc.type,{'field':'type', 'store':'yes'}); return ret; }"
}
}
}
curl localhost:5985/local/dbName/_design/foo/by_subject
returns zero doc_count and empty fields
{"current":true,"doc_count":0,"digest":"3063p3oazx5p237dqdgqtpnen","update_seq":"start","disk_size":0,"doc_del_count":0,"fields":[],"ref_count":2,"uuid":"18bd1
Not sure what would I be missing here
from couchdb-lucene.
I had the same problem and Crispy1975's post provided the solution. If, from couchdb 2.0 onwards, the url has the format http://localhost:5985/local/testDb/_design/search/by_title?q=title:captain this should be added to the README. This would have saved me an hour. Should I do the edit and submit a PR for this?
from couchdb-lucene.
Related Issues (20)
- Can not run CouchDB lucene version 2.1
- Error > httpd 500 error response: {"error":"unknown_error","reason":"undef"} after upgrade from 2.0.0 to 2.1.1
- zero fields indexed HOT 1
- indexing and querying numeric ranges HOT 1
- Bookmarks Usage HOT 2
- Configuration for CouchDB 2.3.0 HOT 6
- pillowtalk support HOT 1
- Does couchdb-lucene offer faceting features, like counts etc? HOT 2
- Autocomplete with couchdb-lucene
- java.io.IOException: Search timed out. HOT 1
- Installation on ubuntu does not work correctly
- Is it possible to configure SSL for couchdb-lucene?
- Sorting on string is not lexicographical HOT 1
- com.github.rnewson.couchdb.lucene.DocumentConverterTest: com.github.rnewson.couchdb.lucene.couchdb.CouchDocument@58c1c010 caused exception during conversion
- When will couchdb-lucene be available on Apple Silicon M1 ?
- couchdb-lucene stucks with indexing if attachment is docx, pptx, xlsx format HOT 1
- Possible to support stale=ok type options?
- Using proximity query as fuzzy search HOT 2
- log4j vulnerabilities HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchdb-lucene.