File search (by content)

There are many ways to support search by content. We'll start with a basic level of support, then consider more as needed.

Initial support

Search criteria

The basic support includes the following search criteria:
  • search string
  • file pattern
  • case sensitivity

Resource support

/resources/applications/{id}/files represents the collection of files within a specific application. Search fits naturally as query parameters sent to the collection.

For example:
GET /resources/applications/1/files?str=foo
returns a list of files (URIs) that contain the string "foo" (case sensitive)

GET /resources/applications/1/files?istr=foo
performs a case insensitive search

Q: The file list already supports filtering on file pattern. Should we just rely on that for now?

Client UI

The file editor/file list seems like the most natural placement for this functionality, especially for rendering just the basic support.

Let's add the support in two ways:

  • "Command strings" within the filter string
  • A dialog that's brought up by clicking on an "Advanced" link located near the filter input field

The dialog would generate the corresponding "command string".

Command strings would delimited by special keys. For example:
.html
shows a list of files with ".html" in their name or path (current behavior)

+s:foo
shows a list of files that contain the string "foo" (case sensitive) in the content

.html+s:foo
shows the intersection of the above two

Looking beyond

Other features to consider:
  • Include dependencies
  • Search across all applications
  • Results include hit count
  • Results include line number/line containing match

r2 - 19 Jun 2008 - 15:33:26 - edchat
Syndicate this site RSS ATOM
Copyright 2007 © IBM Corporation | Privacy | Terms of Use | About this site