@
@
@atambalasi2014-10-18 09:57:55
PHP
@atambalasi, 2014-10-18 09:57:55

How to implement live search for ios application in php API?

I am writing an API for an iOS application, I need to implement live search in the client and in the API. As I put it, in the client we send each entered character to the API, and there in the API there will be a script that makes a request to the database and returns all data from two fields that begin with the received character. The database stores only words, no phrases or sentences. The structure of the base is
+---------+-------------+------------------+--- ------+
| word_id | word1 | word2| user_id |
+---------+-------------+----+------ ---+
| 110 | mainWord | testExtraword | 101 |
| 111 | mainWord | testExtraword2 | 101 |
| 112 | mainWord | Google | 101 |
Programming language for API php 5.4;
DBMS Mysql 5.5;
iOS Objective-C ios SDK;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2014-10-18
@DmitriyEntelis

Where is the question? :)
According to what was said now:
1) In any case, you need to kill for such field names, nothing is clear :)
2) If you want to do a search, it's better to use existing tools, such as Shpinx or elasticsearch. This is an order of magnitude better and better than doing LIKE in sql database.

O
Oleg Gamega, 2015-02-08
@gadfi

api and live search are not connected in any way ─ network delays are too large, the user will only be nervous in vain, send the phrase (part of the phrase) right away, do not spell it. Live search is more for the client, among already cached data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question