L
L
lynnikvadim2015-10-21 16:58:35
Search Engine Optimization
lynnikvadim, 2015-10-21 16:58:35

How to implement a good full-text search on the site?

Now the site uses the following search code code:

OrgModel::whereRaw(
        "MATCH(name_org,description,tags) AGAINST(? IN BOOLEAN MODE)",
        array($string)
    )

But somehow bad looking.
When requesting "store number 9" - he is looking for all stores, but not store number 9.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Latyshev, 2015-10-21
@magalex

Look towards search engines: for example, sphinx

A
Aleksey Ratnikov, 2015-10-21
@mahoho

Try IN NATURAL LANGUAGE MODE instead of IN BOOLEAN MODE.

P
pchemu4ka, 2015-10-22
@pchemu4ka

Read the query language help.
In this case, a search with quotation marks "shop #9" will give an exact match.
This can be sewn into the request, or you can write a hint to the user.
But you will not get a good search from the basic functionality.
If you need a simple search string, then probably the laziest option is Yandex.Search. At least everything is ok with morphology. The only problem is that it searches only for the indexed one.

A
artyvr, 2015-10-29
@artyvr

You can try '+shop +#9'
operators
about search engines

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question