• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using Verity to search source code

New Here ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

I'm writing a help application to keep track of the development of another (larger) coldfusion application. One of the components keeps tracks of variable declarations, and to do this I need to search the source code for instances of the variable name.
I'm using verity but seem to be running into some problems. I've created the collection in administrator using filetypes with extensions .cfm, .cfml, .xml, .html, .htm and WITH subdirectory recursion. It lists approximately 300 files as being indexed, which should be about right.
When I search the collection I'm not getting all the hits I should be. I think the problem is rooted in the fact I need to find substrings of the criteria, which verity doesn't seem to be doing. For example, for a variable someVar it has no problems finding:
someVar
...code... someVar ...code...

but problems seem to arise when looking for things like
# someVar#

I've tried:
<cfsearch collection="rsSourceCollection" name="qSource" criteria="#searchStr#" />
<cfsearch collection="rsSourceCollection" name="qSource" type="explicit" criteria="<wildcard>*#searchStr#*" />
<cfsearch collection="rsSourceCollection" name="qSource" type="explicit" criteria="<wildcard>*'#searchStr#'*" />

... to no avail.

Any help would be greatly appreciated.

Corey
TOPICS
Advanced techniques

Views

417

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 08, 2008 Jan 08, 2008

Copy link to clipboard

Copied

bump?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2008 Jan 08, 2008

Copy link to clipboard

Copied

Oops, sorry: I saw your post back when you made it and meant to have a
think about it and come up with something, but clean forgot. I blame Xmas.

Have you read the docs for how to build Verity search strings?
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=indexSearch02_1.html

Of your three options, I would have expected the middle one to work.

Have you tried just using the internet search type?

Bear in mind, too, that Verity is case-sensitive, if your criteria is
mixed-case. For CF variables which are not cse-sensitive, I'd not be doing
case-sensitive searches.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 09, 2008 Jan 09, 2008

Copy link to clipboard

Copied

LATEST
No problems, thanks for the reply.

I've read over that document to no avail, either I'm doing something wrong or there is something wrong with Verity.

I'm using:

<cfset searchStr = LCase(#qQuery.vars_name#) />
<cfsearch collection="rsSourceCollection" name="qSource" type="internet" criteria="#searchStr#" />


... at the moment, but still am not receiving all results. I know this is the case because a full text search of the project within Eclipse returns A LOT more files containing the variable name. Will internet search look for substrings by default?

One of my biggest problems is when I'm searching for a variable with a period in it, such as 'fusebox.fuseaction'. From my research I've established that verity doesn't like searching on criteria containing fullstops and I need to create a style.lex file to create a mapping between the period character and the entity version of the character, but I can't find any resources to state how the style.lex file should be formatted.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation