This topic describes a good starting strategy to try if you are
working with a document repository.
The strategy assumes the following:
- The search mode is
AllPartial. By using this mode, you ensure that a
user’s search would return a two-words-out-of-five match as well as a
four-words-out-of-five match, just at a lower priority.
- The strategy is based on a
search interface with members such as Title, Summary, and DocumentText, in that
order. The order is significant because a match on the first member ranks more
highly than a cross-field match or match on the second or third member.
The strategy is as follows:
- NTerms
- MaxField
- Glom
- Phrase
(with or without approximate matching enabled)
- Static
The modules in this strategy work like this:
- NTerms, the
first module, ensures that in a multi-word search, the more words that match
the better.
- MaxField
puts cross-field matches as high in priority as possible, to the point where
they could tie with non-cross-field matches.
- The next module,
Glom, decomposes cross-field matches, effectively
breaking any ties resulting from
MaxField. Together,
MaxField and
Glom provide the proper ordering, depending upon what
matched.
- Applying the
Phrase module ensures that results containing the
user’s query as an exact phrase are given a higher priority than matching
containing the user’s search terms sprinkled throughout the text.
- Optionally, the
Static module can be used to sort the remaining ties
by criteria such as ReleaseDate or Popularity.