Since you are in a competitive market, assume that one day your online product met a disaster wherein your product's search result suddenly falls down. To overcome this scenario and survive in such a competitive market, probably you would like to favor documents that have the exact phrase typed by the end-user over the documents that have matches in separate words. We will guide you on how to achieve this in this section.
I assume that we will use dismax query parser, instead of the standard one. Moreover, we will re-use the same
schema.xml that was demonstrated in the Searching for a phrase section in this chapter.
Our sample data looks like this:
<add> <doc> <field name="id">1</field> <field name="title">Annual 2012 ...