You are here:  » Drop Record if Not RegExp problem

Support Forum



Drop Record if Not RegExp problem

Submitted by johnmcg on Mon, 2011-08-01 08:22 in

Hi David,

I'm setting up pricetapestry for ethical/green products.
The test site is {link saved}

I'm setting up multiple copies to create subcategories for 16 main categories.
At this stage, House and Home takes you to another install of pricetapestry under
{link saved}

I'm using the same database for all of them with different prefixes: pt_ for the main installation and a category name for each of the other ie house_ for house and home, health_ for health and beauty etc. I also will be using the common feed directory on the root install, but while testing I'm using one feed directly in the feed folder under /house/.

I'm a bit of a newbie on this but, I've successfully got the 'dynamic category' mapping based on product title working per your http://www.pricetapestry.com/node/1845.

Now I'm having trouble trying to filter the feeds to only these products in that pricetapestry program.

I followed the forum on trying the Drop Record if Not RegExp on http://www.pricetapestry.com/node/3386#comment-13462

and other posts, but I'm getting either total filtering (0 records imported)or too much filtering (5 records importing) out of 800+ records.

I've tried it against the product name field.

On the product description field I get almost all the records imported.

I also tried adding in the code to the includes/filter.php to have all the fields searched and that again gives 0 records imported.

Is my filter list too big?

I've tried both:

(hand towel|bath sheet|bath towel|bath mat|bath robe|wash mitt|door seal|window seal|windows and doors|double glazed doors|double glazed windows|timber windows|timber doors|aluminum clad windows|aluminum clad doors|flooring|floor coverings|floor sanding|decking|natural carpet|recycled carpet|bamboo carpet|carpeting|carpet tiles|furniture|tables|chairs|lounge|timber bed|custom joinery|air conditioners|cooling|ventilator|air conditioning|cooling systems|climate control|wood fired heaters|wood fired stoves|wood chip heaters|hydronic heating|heat panels|domestic fire|geothermal|heat pump|domestic fire|heater|commercial cleaning|residential cleaning|office cleaning|house cleaning|home cleaning|carpet cleaning|upholstery dry cleaning|carpet dry cleaning|real estate|sustainable properties|home for sale|home for rent|house for sale|house for rent|mortgage|homewares|soft furnishings|decor|accent cushions|table linen|throw rugs|recycled paper|bio plate|tableware|table cloths|bowl|cup|cutlery|shower timer|bokashi bucket|bokashi bin|glow brick|room deodoriser|baskets|runners|placemats|napkins|plateware|decorative objects|lamps|downlights|light globe|halogen|led lamp|led light|energy saving globe|sensor light|fluorescent |energy saving lamp|energy saving light|lilliput lamp|lilliput light|bed linen|sheets|pillows|pillow cases|duvets|bamboo linen|mattresses|blankets|manchester|bedding|comforters|doona|quilt|bamboo linen|cotton linen|linen|door|window|windows)

and with the wildcard .* included:

(.*hand towel.*|.*bath sheet.*|.*bath towel.*|.*bath mat.*|.*bath robe.*|.*wash mitt.*|.*door seal.*|.*window seal.*|.*windows and doors.*|.*double glazed doors.*|.*double glazed windows.*|.*timber windows.*|.*timber doors.*|.*aluminum clad windows.*|.*aluminum clad doors.*|.*flooring.*|.*floor coverings.*|.*floor sanding.*|.*decking.*|.*natural carpet.*|.*recycled carpet.*|.*bamboo carpet.*|.*carpeting.*|.*carpet tiles.*|.*furniture.*|.*tables.*|.*chairs.*|.*lounge.*|.*timber bed.*|.*custom joinery.*|.*air conditioners.*|.*cooling.*|.*ventilator.*|.*air conditioning.*|.*cooling systems.*|.*climate control.*|.*wood fired heaters.*|.*wood fired stoves.*|.*wood chip heaters.*|.*hydronic heating.*|.*heat panels.*|.*domestic fire.*|.*geothermal.*|.*heat pump.*|.*domestic fire.*|.*heater.*|.*commercial cleaning.*|.*residential cleaning.*|.*office cleaning.*|.*house cleaning.*|.*home cleaning.*|.*carpet cleaning.*|.*upholstery dry cleaning.*|.*carpet dry cleaning.*|.*real estate.*|.*sustainable properties.*|.*home for sale.*|.*home for rent.*|.*house for sale.*|.*house for rent.*|.*mortgage.*|.*homewares.*|.*soft furnishings.*|.*decor.*|.*accent cushions.*|.*table linen.*|.*throw rugs.*|.*recycled paper.*|.*bio plate.*|.*tableware.*|.*table cloths.*|.*bowl.*|.*cup.*|.*cutlery.*|.*shower timer.*|.*bokashi bucket.*|.*bokashi bin.*|.*glow brick.*|.*room deodoriser.*|.*baskets.*|.*runners.*|.*placemats.*|.*napkins.*|.*plateware.*|.*decorative objects.*|.*lamps.*|.*downlights.*|.*light globe.*|.*halogen.*|.*led lamp.*|.*led light.*|.*energy saving globe.*|.*sensor light.*|.*fluorescent .*|.*energy saving lamp.*|.*energy saving light.*|.*lilliput lamp.*|.*lilliput light.*|.*bed linen.*|.*sheets.*|.*pillows.*|.*pillow cases.*|.*duvets.*|.*bamboo linen.*|.*mattresses.*|.*blankets.*|.*manchester.*|.*bedding.*|.*comforters.*|.*doona.*|.*quilt.*|.*bamboo linen.*|.*cotton linen.*|.*linen.*|.*door.*|.*window.*)

(I don't see a way to upload these as attachments, sorry.)

I really need to get this solved. I have to have a working demo (at least 2 subcategories) for the Organic Expo here in Sydney this coming weekend.

Any advice would be greatly appreciated.

Thanks,
John

Submitted by support on Mon, 2011-08-01 14:04

Hello John,

The first filter value is fine, but by default Drop Record If Not RegExp is case sensitive. This is easy to change, so you can keep your filter value "asis" without having to worry about case. In your includes/filter.php look for the following code at line 72:

      $filter_dropRecordFlag = !preg_match($filter_data["text"],$text);

...and REPLACE with:

      $filter_dropRecordFlag = !preg_match(strtolower($filter_data["text"]),strtolower($text));

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by johnmcg on Tue, 2011-08-02 08:14

Hi David,

Yes it worked out well, thanks.

Just a couple of questions on search:

1) Is the search case insensitive? (ie will lamp Lamp and LAMP return the same results? )
If not can it be made that way?

2) You talk about a global search for all of the other installs of pricetapestry as subcategories http://www.pricetapestry.com/node/3386#comment-13462. Can I get that code too?

Thanks!
John

Submitted by support on Tue, 2011-08-02 08:34

Hi John,

Search isn't case sensitive by virtue of MySQL not being case sensitive for text matching so no problem there. If you could drop me an email with a link to the top level site and 2 of the installations you wish to search I'll customise the sitesearch code and forward that for you - it's must easier to explain the set-up with reference to the actual installation...

Cheers,
David.
--
PriceTapestry.com