[Lxr-dev] [ lxr-Patches-517857 ] File search using filenames stored in db
Brought to you by:
ajlittoz
From: <no...@so...> - 2002-02-15 07:11:04
|
Patches item #517857, was opened at 2002-02-14 23:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=390119&aid=517857&group_id=27350 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Shree Kumar (shreekumar) Assigned to: Nobody/Anonymous (nobody) Summary: File search using filenames stored in db Initial Comment: This patch is a proposed solution to the "Don't require glimpse for file search" feature request. Here's a brief description of the patch : The patches are against the LXR-0.9.1 release. The attached .tgz file has two files - "find.patch" is a patch for the "find" script and "mysql_find.patch" is a patch for lib/LXR/Index/MySQL.pm The patch provided is for the MySQL backend. [It should be easy enough to do the same with postgres] The "find" script calls the "getmatchingfiles" method which returns the list of all files belonging to a particular tag and matching the regular expression entered by the user. The "getmatchingfiles" method executes a query to get all filenames with the specified tag. As each filename is fetched, it is matched with the regexp and rejected if it doesn't match. The list of matching files, along with the count is returned. As Malcolm has pointed out [in the developer mailing list], source trees of large projects can have thousands of files and the memory usage [while the query executes] can become quite high. I haven't measured the memory impact. One possible way to solve this would be by using a cursor. When applying the patch, 2 hunks might get rejected. These are the lines with the "CVSID" stuff - you can safely ignore these. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=390119&aid=517857&group_id=27350 |