[hibernate-dev] [Search] DisjunctionMaxQuery and MoreLikeThis

Guillaume Smet guillaume.smet at gmail.com
Thu Feb 20 10:10:55 EST 2014


Hi Emmanuel,

On Thu, Feb 20, 2014 at 10:19 AM, Emmanuel Bernard
<emmanuel at hibernate.org> wrote:
> ## DisMax as top level DSL feature
>
> Should we add .dismax() like we did bool()?
> I am hard pressed to find a use case.

It's a project I have for a long time. I wanted to have an intern this
year to work on this and a few other search features I have in mind
for HSearch. It becomes more and more obvious I won't have the time to
work on this myself but I wanted to be able to play with this idea
anyway. That said, I haven't found anyone so far...

Background: I worked a lot with Apache Solr before switching to Java
and Hibernate Search.

Apache Solr has a (e)dismax query parser which IMHO is very very useful.

The principle is the following:
- you have a text to search typically: hibernate search is great
- you tell him to search it in title^5 content^2
- you tell him that starting with 3 words, it can ignore 1 (mm
parameter = minimum should match)
and it builds a search query doing exactly that.

The edismax query parser is quite advanced, sometimes a little buggy
but it's usually what I want when I implement a search engine. The
only thing we have added so far in our Solr powered application is the
fact that we also support search in fields with a fuzzy query. So you
can have: title~0.8^5 content~0.8^2 (it's not perfect as fuzzy queries
are weird but it does the job and you use it only if you want it).

Reference is here: https://wiki.apache.org/solr/ExtendedDisMax

The most interesting parameters to understand the principle are qf and
mm, but the others are quite useful too.

Happy to discuss this subject.

-- 
Guillaume


More information about the hibernate-dev mailing list