Indexing and Query Support
According to http://www.couchbase.org/get/couchbase/2.0.0, the server has new indexing and query support.
I just downloaded the server version and read the java API (spymemcached), I couldn't find how to index my objects' fields or do any query.
Am I looking at wrong place?
PS: The installation on Redhat 5.x is very painless and the web admin portal helps a lot.
It would be great to have the documentation that tells how to:
- the concept of indexing documents (how fields in json document are indexed)
- the concept of view (maybe the same as couchdb)
- how to access data by the indexes (does it have to be one view per index and we access the view that matches the search criteria/index?). What if I have 50 fields in a document and I want to index them all and my users can search on any of the fields? Do I have to create 50 views?
Thanks.
Sounds good Edy, I'll postpone answering those here and work with our team to get the relevant information posted somewhere for all to consume.
Thanks again, let me know if you don't get some adequate answers in the next few days/week.
Perry
Let's start here: http://docs.couchbase.org/couchbase-manual-2.0/couchbase-views.html
Perry
I just took a look at the spymemcached 2.7 javadoc, it's not immediately clear to me which APIs I could use with the views. Is it in 2.8?
Perry,
Thanks for the doc regarding View.
I have a design question regarding index/query. Supposed I have an object with 50 fields, and total object count is 20 million and I want my users to search on any of the fields and expect the response to come back in milliseconds (I've done this in Lucene), is this something that Couchbase Server can support?
What about transaction, is it supported by Couchbase Server?
@timliaw
The apis for view support are in the 2.8 developer preview of Spymemcached. You will want to use the CouchbaseClient class. Let me know if you have any other questions.
I've been searching for a while and I can't find what I'm looking for... I'm hoping to get some help here. In Javascript I can interact with my Couchbase server with Nodejs and examples like this:
var connection = new require('net').createConnection(11211, 'localhost');
connection.addListener("data", function (data)
{
var buffer = '';
buffer += data;
console.log(buffer);
});
connection.write("set account7 0 0 19\r\n{'userName':'Nate'}\r\n");
connection.write("get account7\r\n");This works but I want to be able to get from the server every document with a certain username. For example, I want to ask the server for every document with 'userName' equal to 'Nate'. Can I create view to do this and query it, not from Couches web interface but from JavaScript?
Thanks.
EDIT: The problem was that I was connecting through port 11211 which uses memcache protocol... couchdb commands can be used through port 8091 (or whatever port you use to connect to the web interface).
You're looking in the right place! Once we get you the information you need, it would be nice if you could help us figure out how we could have made it easier for you.
From within the Web UI, you can now select "views" and define a bit of javascript to do the actual querying/indexing.
You will define the views here, and then query them via spymemcached.
We just released the product on Friday, so we're working on building up the documentation as we speak.
Please let me know what else we can do to help.
Perry
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!