1

I have done a JSONDocMgr.write(docId, handle); in my java application. The json data is loaded from a file. I can see my document in http://localhost:8000/qconsole/, but the case is that I need to use REST services to query the DB. The docId is /books/text.json, when I try to do a GET using postman http://localhost:8000/books/search?q=harry I'm getting Page Not Found. Can someone please help me on this.

1
  • FileInputStream docStream = new FileInputStream("E:/Lara/text.json"); This how I read my file. Commented Mar 22, 2017 at 15:42

1 Answer 1

1

To get your document via REST see /v1/documents. For example:

curl -i --digest --user myuser:mypwd -X GET \
  'http://localhost:8000/v1/documents?uri=/books/text.json'

To search documents via REST see /v1/search. For example:

curl -i --digest --user myuser:mypwd -X GET \
  'http://localhost:8000/v1/search?q=harry'

Make sure the port and username you use for REST matches the port and username you use in Java.

Sign up to request clarification or add additional context in comments.

3 Comments

I see that localhost:8000/v1/search?q=harry searches the entire document list, can I be more specific about the document it searches for?
Yes, that endpoint lets you write lots of different types of queries. See Using and Configuring Query Options in the REST API Guide for more information.
Also, you can use the Java Client API to read your document and do searches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.