By Glorifindal on
Hi there,
I am ltrying to create a type of report - perhaps by modifying the Search Module - actually using a copy of it - and using a reg expression - then instead of displaying the results, creating a txt file with the results,
here is an example of what I want to find:
I have an array of apple, orange, pear
When I use my module, I would want to get the results
Apple 13
Apple 17
Orange 4
Pear 9
Pear 3
1 Apple 7
Anyone have any idea how this could be achieved ?
Kindest Regards
Glorifindal
Comments
Hi
Hi,
Just try the trip search module in drupal.you can achieve your result.For example if teh word apple comes in ten times it shows apple(10).
Thanks,
Raj.
Finding nodes containing particular words
(I need a solution that works in Drupal 6 - Drupal 5 specific modules will not do).
The first step is to identify each node in my site that contains a given word, say, 'Apple'.
When I can do this I need to make the search/survey/index more specific by only recording matches for the (case-insensitive) regular expression /apple\s+\d+:d+/ .
Finally I want to be able to do this for a number of words (about 60), Apple, Banana, Cranberry ... (Hence the term array in the first post).
Grateful for any comments or advice, apologies for not being clear enough in my first post
SQL Pattern Matching
You'll probably want to look at the documentation for pattern matching in MySQL and/or PostgreSQL (doesn't look like you can maintain compatibility).
Not sure if you can use the do_search() function here. Or do your own query with db_query().
This would probably be faster than getting every node, then using preg_match.