Giter Site home page Giter Site logo

Comments (9)

Crispy1975 avatar Crispy1975 commented on September 26, 2024 4

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.

huyentk avatar huyentk commented on September 26, 2024 1

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

vimalabhi89 avatar vimalabhi89 commented on September 26, 2024 1

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.

rnewson avatar rnewson commented on September 26, 2024 1

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

toyssamurai avatar toyssamurai commented on September 26, 2024 1

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.

huyentk avatar huyentk commented on September 26, 2024

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.

Crispy1975 avatar Crispy1975 commented on September 26, 2024

@huyentk happy to help... can you post the content of the view by_content?

from couchdb-lucene.

vimalabhi89 avatar vimalabhi89 commented on September 26, 2024

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

leforestier avatar leforestier commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.