To use the search facility is quite simple, you will need the following elements:
View
Function
Event
From the View page, select "Widgets" - "Search"
To keep it simple just change the name to search - it then needs to be linked to the Event that you want it to appear in
Select "Events" then select the event you want the search to appear in.
add to the content box
{view:search}
this is the parameter that will display your search box.
I am going to presume you already have a view setup, in the very basic scenario you should have something like:
{fn:read_data_my_data}
{view:search}
{view:table1}
you now need to add the configuration that you need to the function that you are calling, for this there are 2 options.
1. scroll to the bottom of the function page and add the model.field that you want to search in. (the field is the field from the database you want to search in that is related the the model that queries the database) you can search in more than one Model if you want to.
Model.field:{data:keywords}
If you add more than 1 "search term" in the search field when it is processed the database query treats it as an AND this means your searching for the same term in each field. If that isn't your desired query then you need to use option 2.
2. At the top of the function is the Where conditions simply add the search terms (in the Model.Field format) as below
model.field:{data:keywords}
OR
model.field:{data:keywords}
OR
model.field:{data:keywords}
the term {data:keywords} doesn't need to be changed unless you change the search parameter name in the function view.
Once you have completed the above, add {debug:} to the "View" this will allow you to see what is being queried and assist in debugging problems.
I think I am correct in thinking that if you have limited the "Fields to be retrieved" then your limited to searching in those areas only.
Regards,
Dave