215 Posts
iliil
7 years ago
8
Topic

Hello Sebloders.

I have a search list (article) with around 4000 items. I was trying to figure out why is the searching soo slow and I found out that it's because search join field. I use the field just in order to join the #__contentitem_tag_map table to be able to seach by tag. When I remove the search join field from the search form, searching is about 100 times faster? 

1)Without search join field - OK!

1)With search join field - VERY SLOW..

Is this normal or I am doing something wrong?

Is there a way to let's say dynamicaly enable/disable the search join field only when needed (e.g. only when I select the tag i'm searching for)? I tried restrictions but doesn't work for this field.

Many thanks for advices

Michal

Get a VIP membership
1283 Posts
Bucklash
7 years ago
0
Level 1

Hi

Searching by tag works without the join requirement. 

A few versions back it got sorted out. 

215 Posts
iliil
7 years ago
6
Level 1
Hello Bucklash, thanks for reply.

Yes, I know. there is a way to add the SEBLOD jform tag field in the search form ( which basicly joins the same table itself ). But searching by tag is not the point.

The point is that the search join table slows down the searching extremely. And It doesn't even metter if you do search a data from joned table or not. It is possible that I'm doing something wrong, but everything seems clear to me.

So I guess my questions are:
1) Do you have the same experience or I overlooked something?
2) If that's the way it is, is it possible to manage that the tables would join dynamically ONLY when searching the data from the tables? ( like the jForm tag field does -> if the tag is not selected - the #__contentitem_tag_map is not joined.
3) I would be happy if you share basicaly any experience with joining tables in SEBLOD search list. Again, it's not about joomla tags, it's about the ability of joining custom tables.

Thanks for help

Michal

1283 Posts
Bucklash
7 years ago
5
Level 2

Sorry

Not much I am able to help with.  

Have done joins before but never noticed (looked for) any side effects....

Hope you get it sorted. 

4229 Posts
Kadministrator
7 years ago
4
Level 3

Reason is simple - your query becomes slow for some reason - you are joining tags to all articles, so with 4000 articles and few tags each you can easily get into big numbers. Probably you would need to add some indexes on the tables.

215 Posts
iliil
7 years ago
3
Level 4

Thanks for your answer, Klas.

That makes sense. But did you mean to play around with the indexes even on core joomla or seblod tables (e.g. #__contentitem_tag_map)?

I was also thinking that it would be really great if search join field was conrolled  by restriction rules (e.g. enabled only when the tag field is selected) but i'm not lucky to apply the restriction rules on search join table field.

------

The last option I see is to create own custom SEBLOD  field plugin used in the search form with onCCK_FieldPrepareSearch function, which would manage to  join the table only when the value of the field is selected in the form.

Can you please shortly comment on the restriction possibility?

Thanks

Michal



4229 Posts
Kadministrator
7 years ago
2
Level 5

An additional index on join columns of core tables should not be a problem unless you do a huge number of inserts. 

Are you saying that restriction does not work on join field (or do you refer to conditionals, which are client side?)

215 Posts
iliil
7 years ago
1
Level 6

Thanks SO MUCH for your reply which led me to solve this.

The problem with restrictions was that I applied the "Fields"restriction (new SEBLOD restriction plugin) which, I assume, is client side (like conditional states) . With URL restriction I'm able to enable/disable the join field and that's enough I need for my situation

The searching process is now  fast, as the additional table is joined only when searching data from it!

Thanks again, Klass!

Michal

4229 Posts
Kadministrator
7 years ago
0
Level 7

Hi,

any restriction plugin is server side, could be it was not configured correctly (sometimes even fields order matters).

Get a Book for SEBLOD