|
Search
----------------------------------- Strategy Outline ----------------------------------- Overview There are basically 2 functional parts to this project and 2 display parts. We decided each of the functional parts has, in essence, 2 levels of complexity we can develop. We figure in the interest of getting functionality down, then expanding to more features, we broke each into 2 potential phases of development. We'll start with functionality (1) for each then, time permitting, incorporate functionality (2):
2. Multi-term search (ie: multiple "search terms" can be strung together with AND/OR, parsed on back end and custom searched accordingly) 2. Form-based filtering The display parts are basically:
2. Profile display Implementation Separation of front-end and back-end development To best separate font- and back-end, we'll use a true model-view-controller separation of implementation:
2. View: Calls to Model.search() To accommodate this with minimal editing of code for feature enhancement, we decided on a format for search calls to be uniformly called. To implement, each model we will search by (we'll compile a complete list) will implement a "search" method. This method will take as its argument a dictionary in the format modeName.search({"field" : "search Term", "field2" : "search term 2", ...}). For the first round of implementation, we will simply pass all arguments in a dictionary with a single entry: modelName.search({"all" : "search term"}). This way, we know we are searching all fields for a single search term, but if we have time to expand functionality, we do not have to modify the function signatures, only the handling of the argument to accommodate multiple fields. Results Format Results from each search method above will be in a consistent format to allow for easy handling. The results returned will be a dictionary formatted as follows: return { "facultyID1" : { "modelName" : "resultID1", "resultID2", ... } "facultyID2" : { "modelName" : "resultID1", "resultID2", ... } } While at first glance the "modelName" item seems redundant, since we made this call to a specific model, but this will allow for easier handling when we compile results from multiple models... Results Compilation (handled by controller) Each result will be received by the controller and combined in the format below: { "facultyID1" : { "modelName1" : "resultID1", "resultID2", ... , "modelName2" : "resultID1", "resultID2", ... , ... } "facultyID2" : { "modelName1" : "resultID1", "resultID2", ... , "modelName2" : "resultID1", "resultID2", ... , ...} "facultyID3" ...} This will allow us to display results grouped by faculty members with search results identified by what exactly matched the search term, which will look something like: SEARCH RESULTS FOR "SWE":
o Class: CS373 - SWE o Conference: SWE in the real world
o Website: www.swe.com o Writing: Why the world needs SWE |