? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
30 Nov 2017

Summary of Changes

As discovered by recently, the search content plugin is slow with a lot of articles and fields. See pr #18915 for more information.

This pr splits up the search in articles and fields to improve the performance. A new function in the FieldModel is introduced which allows to search in fields. It allows other extension devs to easily integrate custom fields search into their extensions.

The cost is that there are two queries being executed.

Why a different approach than #18915

Search should be independent of the server type and easily being adapted by extension devs.

Testing Instructions

See #18915.

Expected result

Search should be fast.

Actual result

Search is slow.

avatar laoneo laoneo - open - 30 Nov 2017
avatar laoneo laoneo - change - 30 Nov 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Nov 2017
Category Administration com_fields Front End Plugins
avatar laoneo laoneo - change - 30 Nov 2017
Labels Added: ?
avatar GeraintEdwards
GeraintEdwards - comment - 30 Nov 2017

Hi Allon - I like the idea of splitting out the fields logic but there is a logical issue with your approach I think.

When you search 'all' and search for two words e.g. "apple" and "pear" - an article with "apple' in the title and 'pear' in a custom field should be returned. In your approach this will not happen.

avatar GeraintEdwards
GeraintEdwards - comment - 30 Nov 2017

I just ran a test search and can confirm that the correct results are not returned when searching for 'all words'

avatar laoneo
laoneo - comment - 30 Nov 2017

Yes, discovered that as well about an hour ago. An idea how to fix it?

avatar GeraintEdwards
GeraintEdwards - comment - 30 Nov 2017

when doing all you need to search for each word separately and return these muliple lists and incorporate them into the plugin search in the way that I did. It took me a little while to figure out the logic.

So you could look at how I do it in my PR and replicate the underlying logic but calling your field model code for the lists of matching item_ids

avatar laoneo
laoneo - comment - 30 Nov 2017

Didn't get you. Can you explain it a bit more?

avatar GeraintEdwards
GeraintEdwards - comment - 30 Nov 2017

In pseudo code we need (for all words matching):

(a.title like word1 OR a.introtext like word1 ... OR a.id IN (fields matching word1))
AND
(a.title like word2 OR a.introtext like word2 ... OR a.id IN (fields matching word2))
etc.

I guess it may be possible to combine these into a single query in your model and extract the separate groups of ids from the result set in some way but its not trivial and the extra PHP processing may cancel out the DB gains.

avatar laoneo
laoneo - comment - 30 Nov 2017

Closing as we can't properly, in a simple efficient way, handle the all combination.

avatar laoneo laoneo - change - 30 Nov 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-11-30 14:06:11
Closed_By laoneo
avatar laoneo laoneo - close - 30 Nov 2017

Add a Comment

Login with GitHub to post a comment