queries using "like" of mysql ?
Hi, I need to search some word into different columns.
For example here:
{"total_rows":10,"rows":[
{"id":"post_0","key":"This is Post 0","value":["blablablabla blabla anibal 0","http://www.xxxx0.com/0"]},
{"id":"post_1","key":"This is Post 1","value":["blabla anibal 1","http://www.xxxx1.com/1"]},
{"id":"post_2","key":"This is Post 2","value":["anibal 2","http://www.xxxx2.com/2"]},
{"id":"post_5","key":"This is Post 5","value":["blablablabla blabla anibal 5","http://www.xxxx5.com/5"]},
{"id":"post_6","key":"This is Post 6","value":["anibal 6","http://www.xxxx6.com/6"]},
{"id":"post_7","key":"This is Post 7","value":["blablablabla blabla anibal 7","http://www.xxxx7.com/7"]},
]
}
i want to get only post that contain the word "bla" for example:
{"id":"post_0","key":"This is Post 0","value":["blablablabla blabla anibal 0","http://www.xxxx0.com/0"]},
{"id":"post_1","key":"This is Post 1","value":["blabla anibal 1","http://www.xxxx1.com/1"]},
{"id":"post_5","key":"This is Post 5","value":["blablablabla blabla anibal 5","http://www.xxxx5.com/5"]},
{"id":"post_7","key":"This is Post 7","value":["blablablabla blabla anibal 7","http://www.xxxx7.com/7"]},
thanks, but i allready have mysql ... i don't want to continue with this.
I'm looking new solution to do search engine ...
for example using solr or elastic search, but elastic search with couchbase doesnt work for me :(
This post is in the 1.8 Forums, so I am assuming you are using 1.8.x. Integration is not automated in 1.8.x. In order to integrate Elastic Search with 1.8 you actually have to do a "workaround" in your application code. The way you do it is through "dual-writing" techniques. Using Ruby it's pretty straightforward.
In your *Application Code•: On every document Create, you also create in Elastic Search, but only send it the fields and ID that you require. On Delete, you delete from Elastic Search. There are many ways of doing this. It's a "dual-write" pattern. It's really only a workaround.
Couchbase 2.0 offers more tightly integrated solutions as well as integrated Map/Reduce to do much of what you are trying to do. Elastic Search and Map/Reduce are features of Couchbase 2.0 that would allow you to do text based indexes searches on JSON values (Documents). This is why we are so excited about 2.0.
One way you can do this is by taking a back up of the data file(.mb file), convert into .sql file and load it into sqlite. Then you can login into sqlite db and run the query.
(OR)
The .sql file generated is kind of a unix text file which you can grep(or use other unix utilities) for the data you need.
/opt/couchbase/bin/cbbackup /opt/couchbase/var/lib/couchbase/data/default-data/default /tmp/
/opt/couchbase/bin/sqlite3 default-1.mb .dump > /tmp/default1.sql