Search Filter

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
jerhinesmith
Posts: 7
Joined: 09 Sep 2005, 19:06

Search Filter

Post by jerhinesmith »

Can anyone tell me if the search function in version 1.0(+) looks at custom fields?

I'm using a 0.18 version and don't have access to anything more recent.
jerhinesmith
Posts: 7
Joined: 09 Sep 2005, 19:06

Post by jerhinesmith »

Nobody has any idea?

All I'm asking is that, for example, given a custom free text field, will that information be looked at when doing a search from the "View Items" screen?
atomoid
Posts: 108
Joined: 18 Aug 2005, 00:46
Location: santa cruz, ca

apparently so

Post by atomoid »

was trying to figure out if its possible to enter a boolean expression in the search field to limit all the matches (so far no luck) anyone?

Heres something from the manual: -- The Search field will look for simple keyword matches in the summary, description, steps to reproduce, additional information, bug id, or bug text id fields. It does not search through bugnotes...

...however, i did come across (if its not already too late) an apparent solution for the question raised in this thread (havent yet tried it myself):

---- http://manual.mantisbt.org/manual.page. ... s.page.php ----
#I'm currently using a customized version 0.18.0rc1 of Mantis.
#Allthough I don't know if it is meanwhile possible to use filter search
#over custom fields too in newer versions, here is my solution to make
#it possible:
#You need 3 changes in core/filter_api.php in
function filter_get_bug_rows(.....

#on top of this function add:
$t_custom_field_project_table=config_get('mantis_custom_field_project_table');
$t_custom_field_string_table=config_get('mantis_custom_field_string_table');

#then change
#array_push( $t_where_clauses,
#"((summary LIKE '%$c_search%')
# OR ($t_bug_text_table.description LIKE '%$c_search%')
# OR ($t_bug_text_table.steps_to_reproduce LIKE '%$c_search%')
# OR ($t_bug_text_table.additional_information LIKE '%$c_search%')
# OR ($t_bug_table.id LIKE '%$c_search%')
# OR ($t_bugnote_text_table.note LIKE '%$c_search%'))" ) ;
#
#by:
array_push( $t_where_clauses,
"((summary LIKE '%$c_search%')
OR ($t_bug_text_table.description LIKE '%$c_search%')
OR ($t_bug_text_table.steps_to_reproduce LIKE '%$c_search%')
OR ($t_bug_text_table.additional_information LIKE '%$c_search%')
OR ($t_bug_table.id LIKE '%$c_search%')
OR ($t_bugnote_text_table.note LIKE '%$c_search%')
OR ($t_custom_field_string_table.value LIKE '%$c_search%')
; )" ) ;
# as you see the -OR- part with $t_custom_field_string_table is new
#
# then add a new JOIN clause:
array_push( $t_join_clauses,"LEFT JOIN $t_custom_field_string_table ON $t_custom_field_string_table.bug_id = $t_bug_table.id"; ) ;
# that's all
# injoy,
# regards, Johannes Heinz
Post Reply