Open
Bug 474095
Opened 17 years ago
Updated 16 years ago
New Hook to allow extensions to refine queries or add new (meta) search fields
Categories
(Bugzilla :: Extensions, enhancement)
Bugzilla
Extensions
Tracking
()
NEW
People
(Reporter: lemma, Unassigned)
References
Details
Attachments
(1 file)
7.94 KB,
patch
|
mkanat
:
review-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.3 (like Gecko)
Build Identifier:
There's currently no way for an extension to modify the way Bugzilla searches. I'm currently developing an extension that allows searching summaries and comments using an external fulltext index and found I needed a Hook like that.
I think it makes sense for the Hook to consist of 2 things:
- A supplemental search module should be passed one search term of the boolean chart at a time and decide if it can handle it.
- The fields in the chart should be extendable by custom meta-fields (which are derived and have no database counterpart) that the extension can handle.
Reproducible: Always
Reporter | ||
Comment 1•17 years ago
|
||
This is my first try at implementing this feature. I don't have a lot of perl experience so this might not be idiomatic.
Some things in detail:
- Letting Bugzilla find out how it would handle the search first has the benefit of letting the supplemental search module use this search term in addition to what it derives itself.
- fields and supptables are only added to the actual fields and tables searched through after the search module ran. This allows the module to pop tables that are no longer needed to be joined.
Particular things I am unsure about:
1. Passing all of %func_args to handle_search allows the extension to do more things. However Bugzilla and the extension could be cleaner separated by passing it only a copy of it (would introduce some more overhead though).
2. Meta fields aren't of type Bugzilla::Field but are only hashes. Thus they need to be inserted after the sorting is done in query.cgi and always appear at the bottom of the list.
Attachment #357474 -
Flags: review?(justdave)
Reporter | ||
Updated•17 years ago
|
Attachment #357474 -
Flags: review?(justdave) → review?(mkanat)
Comment 2•17 years ago
|
||
Comment on attachment 357474 [details] [diff] [review]
v1
Just to get this out of my review queue:
We want to refactor Search.pm so that it doesn't use regexes with commas in them. We want to refactor into constants that handle the individual search types and then their exceptions for specific fields.
Attachment #357474 -
Flags: review?(mkanat) → review-
Updated•17 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•16 years ago
|
Component: Query/Bug List → Extensions
Updated•16 years ago
|
Assignee: query-and-buglist → extensions
You need to log in
before you can comment on or make changes to this bug.
Description
•