You can use a bool query with 2 should clauses. At least one clause has to be satisfied.
You can boost the exact match clause so results will appear on top.
No. The normal way to handle this is to put a large boost on the query you'd prefer to match and just sort by score (the default). You can even use a constant score query to remove the regular scoring and just use the boosts, but I don't think that is a great idea usually.
If you really really want to remove hits that only match the second query you can use named queries to see which of your queries you matched which hit and do the filtering in your application. It is usually simpler to just use score though.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.