1 Reply Latest reply on Nov 22, 2010 4:39 PM by jschellSomeoneStoleMyAlias

    ask for a design pattern

      Note: THis is a cross post at stackover .

      Got no answer ,so post it here. :)

      We are working on web application with a search model.

      In the search servlet it capture the request parameters from the client, and then build a hibernate-search query for searching.

      Now the problem is the parameters from the clien are mutable!.

      All the parameters we accepts are listed as following:


      The keyword(s) using for searching,a search request can be processed even just this parameter is passed. Valid example:



      These four parameter must occur at the same time or never.Since these four paramers are used for a TermRangeQuery in lucene.If one of them occur,the rest three must be occur also. And,these four parameter can occur with the "keyword" at the sametime. Valid example:



      This is used to limit the search scope(just search within the special category).


      These two parameters are using for paging.


      The returnFields which will be retivived from the index(if it is Stored in the index) and return to the client.

      So I have no idea about how to build the query using the estimate syntax(if....else....if...).

      Anyone can tell me how ?