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.
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
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.
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 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!