On the surface this looks like you could use the minimum should match feature of the dismax handler and alter that behavior depending on whether or not the search is your main search or your fallback search as you described in your (c) case.
On Sat, Oct 20, 2012 at 1:13 AM, Uma Mahesh <umamaheshkotap...@gmail.com> wrote: > Hi All,I am new to SOLR. we have few requirements as following below. > a) "*MatchAll*" : match all of the search terms supplied by the user. That > is, all results need to satisfy the query (term1 AND term2 AND term3) ... > etc. > b) "*MatchPartial*" : match just some of the search terms supplied by the > user where three or more terms are used. So, for instance, for a search > query that includes five terms we would want to return all results that > contain a minimum of three matches. > c) "*MatchAllPartial*" : match all search terms (i.e. "MatchAll" above) BUT > if that fails to return any results then fall back to matching just some (at > least N-2) of the search terms (i.e. "MatchPartial" above). This strategy > implies that each search issued by the end user could theoretically mean > that two Solr queries are made: the first will use the "MatchAll" strategy > and (if that returns no hits) the second will use the "MatchPartial" > strategy. The logic required to manage this will need to be added to custom > hybris code. > d) "*MatchAny*" : match at least one search term supplied by the user. All > results need to satisfy the query (term1 OR term2 OR term3) ... etc. > e) "*MatchAllAny*" : match all search terms (i.e. "MatchAll" above) BUT if > that fails to return any results then fall back to matching at least one > search term. Again, this suggests that each user search could theoretically > require two Solr queries to be made with custom hybris code responsible for > managing the outcome. > Our requirement is to have a separate solrconfig.xml to each strategies. > Client would be changing the strategy rarely. > I guess for match all I can use dismax query handler. > For MatchPartial I am not sure whether Ngramtokenizer > How can we implement *MatchAllPartial* and *MatchAllAny*?? > Can any one provide me some inputs. > Thanks > Mahesh > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Solr-Partial-word-search-in-a-sentance-tp4014895.html > Sent from the Solr - User mailing list archive at Nabble.com.