O
O
olijen2015-12-28 14:21:12
Yii
olijen, 2015-12-28 14:21:12

Yii full text search for CRM. How to implement?

It is necessary to implement full-text search in CRM. What are your ideas on how best to implement this on Yii 1.14 + php + mySQL? Sphinx is not suitable because it needs to be pre-installed on the hosting, but I would like a solution for the system "out of the box". It is not always possible to write a script that will do this on its own (install a sphinx or similar software). not always hosting will allow, but the product is designed for any hosting, not just VPS. Essence of the problem:
Global search should provide finding essential objects in the system, their presentation and operations on them if they satisfy the search conditions.
1. Simple search. When entering a word or several words in the search field, the system must find all objects in which these words occur. At the same time, it is necessary to show "essential" objects. For example, if the user entered the word "Washington" and this word was found in the user's address, then it is necessary to show not the user's address, but, of course, the user himself and indicate that the search word was found in the address.
The search should return something like this:
John Smith, 101 Main St, Washington DC.
Search results should be presented page by page, with a checkbox for each result. Checkboxes are needed so that the user can mark the results of interest to him.
2. Advanced search. Once the user has landed on the search results page, they can re-search using advanced features.
The page title should contain:
a) A search field in which search words are indicated (what the user entered in a simple search)
b) Radio buttons: Exact phrase, All words, Any word
c) Checkboxes indicating modules

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kompi, 2015-12-28
@kompi

FTS on mysql is, by definition, very slow, and even for CRM, which obviously more than one person will use, plus the amount of information will constantly grow - such queries will plunge into permanent script dumps due to waiting for mysql processing to finish.
Those. trying to get by with a non-specialized solution now, you will have big hemorrhoids in the future.
My implementation thoughts:
Describe the fts business logic in interfaces/abstract classes. Make one implementation with mysql native tools, the other with sphinx.
Test the first option with demo data close to the real ones. Those. find the approximate volume after which degradation in performance begins. And then add a note to the crm description that when a certain amount of data / records is reached, it is recommended to connect sphinx, otherwise there will be a significant performance degradation when working with mysql.
Firstly, the client will be warned, and secondly, a more or less painless implementation of the fts transition from mysql to shpinx will be immediately ready.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question