Fulltext Search with InnoDB

Along with the general phasing out of MyISAM, InnoDB full-text search (FTS) is finally available in MySQL 5.6.4 release. Lots of juicy details at https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html. While other engines have lots of different features, this one is InnoDB, so it’s native (which means there’s an upgrade path), and that makes it a worthwhile option.

How to throttle search (based on typing speed) in iOS UISearchBar?

Try this magic: – (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ // to limit network activity, reload half a second after last key press. [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(reload) object:nil]; [self performSelector:@selector(reload) withObject:nil afterDelay:0.5]; } Swift version: func searchBar(searchBar: UISearchBar, textDidChange searchText: String) { // to limit network activity, reload half a second after last key press. NSObject.cancelPreviousPerformRequestsWithTarget(self, selector: “reload”, … Read more

Update only specific field value in elasticsearch

As a codebased contribution to this answer, the following query may be used: POST /index/type/100100471/_update { “doc” : { “yourProperty” : 10000 } } This query updates yourProperty property only. As a result, this response appears: { “_index”: “index”, “_type”: “type”, “_id”: “100100471”, “_version”: 1, “_shards”: { “total”: 0, “successful”: 1, “failed”: 0 } }

How to find a value in an array of objects in JavaScript?

If you have an array such as var people = [ { “name”: “bob”, “dinner”: “pizza” }, { “name”: “john”, “dinner”: “sushi” }, { “name”: “larry”, “dinner”: “hummus” } ]; You can use the filter method of an Array object: people.filter(function (person) { return person.dinner == “sushi” }); // => [{ “name”: “john”, “dinner”: “sushi” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)