Experience summary about ivx full-text search function

In ivx, full-text search is often used to realize the search function of cases such as forums / blogs / articles. It will automatically perform word segmentation and matching according to the user's search content. Let me talk about the specific use method today.
Ixx's full-text search currently uses the ES engine (Elastic Search). We can set up a full-text search for any field in the database. After checking this field, it will enter the full-text search library. We can query through the full-text search action of the database. Select the exact match option for sorting and filtering, or Chinese / English word segmentation. It should be noted that although full-text search can do accurate search and positioning of the text, it consumes more background service resources. It is best to confirm that this field does have this requirement before adding it.
Experience summary about ivx full-text search function
Experience summary about ivx full-text search function
In the demo, we set up full-text search for the title and content fields. Click the search button to perform full-text search on the database. We can see that there are more columns in the output object array, and the relevance score will be sorted as the output result. The basis for the hit word is the matching result of the search. Each field where the full-text search is set corresponds to one of the sub-arrays. We can use it to highlight the hit word in the display effect.
Experience summary about ivx full-text search function
Experience summary about ivx full-text search function
Experience summary about ivx full-text search function
Experience summary about ivx full-text search function
Here, the highlighting text attribute of the text component is used. It can be directly filled with words or data bound to an array. In the demo, we will fill the highlighted text attribute of the text component that displays the title into the corresponding hit word subarray "Title", the text component of the display content is also bound to the sub-array "content", so that the display effect in the following figure can be achieved.
Experience summary about ivx full-text search function
Experience summary about ivx full-text search function

Guess you like

Origin blog.51cto.com/14556317/2488098