Created
July 10, 2012 16:20
-
-
Save mrvisser/3084440 to your computer and use it in GitHub Desktop.
New solr search "parameters" handling whiteboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DomainObjectQueryHandler will assert a generic "SearchInfo" data-type | |
public abstract class DomainObjectQueryHandler<T extends SearchInfo> { | |
... | |
public abstract T buildSearchInfo(HttpServletRequest request); | |
... | |
public String refineQString(T searchInfo) { | |
return null; | |
} | |
} | |
"T" would be asserted on the implementation of DomainObjectQueryHandler object: | |
public class LibraryContentQueryHandler extends DomainObjectQueryHandler<LibrarySearchInfo> { | |
... | |
// the query handler will be responsible for building / producing the object based on the request | |
// TODO: may need to to also input default "template options" | |
public LibrarySearchInfo buildSearchInfo(HttpServletRequest request) { | |
LibrarySearchInfo info = new LibrarySearchInfo(); | |
info.setUserId(request.getParameter(...)); | |
... | |
} | |
// the search info data-type would then feed into the query string generation | |
public String refineQString(LibrarySearchInfo searchInfo) { | |
return "userid:"+SearchUtil.escapeQueryChars(searchInfo.getUserId()); | |
} | |
// the notion of "loadUserProperties" would no longer exist and be replaced with buildSearchInfo(...) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment