Skip to main content

SQL Filters / Wildcard searches

More
12 years 1 month ago #254 by redactie
Version 2.5.1406 introduces a new filter allowing to use plain mysql queries as filter
Code:
hits > 5 || ((adddate + interval 2 day ) > now() )
This will show popular and recent items only.

The query can be used to perform wildcard searches
Code:
Title like '%black%
'

Keep in mind that wildcard ( or regexp ) queries are not very efficient and might result in slow queries. It is far beter to perform this kind of searches during import:
Code:
if ( stripos($item['description'],'black') !== false ) { $item['menu_9']='black'; }

and use Select9 ( which is menu_9 ) as a normal excact match filter in the menu configuration

Please Log in to join the conversation.

More
11 years 11 months ago #712 by Soener
could this also used to exclude items? if yes, how?

Please Log in to join the conversation.

More
11 years 11 months ago #715 by redactie

Soener wrote: could this also used to exclude items? if yes, how?


if you can use exact match ketwords you can use the 'normal' filters using a '-' sign

so -other will exclue keyword other.

otherwise a query to eclude would be
Code:
Title not like '%black%
The following user(s) said Thank You: fabio, Soener

Please Log in to join the conversation.

More
11 years 9 months ago #1000 by mackelito
Hmm.. I cant get this to work...
I have entered "Title like '%black%' " in the modules "SQL Filter"....

But no results.. not even if I enter "Title like '%%' " :P

Please Log in to join the conversation.

More
11 years 9 months ago #1001 by mackelito
Oooooh ok.. It must be on a com_datafeed page!... hmm.. ok....
Is there some way to not display any products on a page? If I set number of Items to 0 I get a server 500 error.

Please Log in to join the conversation.

More
11 years 9 months ago #1002 by mackelito
Should I not get just the once that start with "a" if I enter "Select2 like 'a%'" in the SQL filter?

Please Log in to join the conversation.

Time to create page: 0.699 seconds