solrluceneedismaxdismax

dismax and edismax returns different results


I am using Solr for my website. The document has two fields: genre and topic. For example, if I want to search a novel about love, then the solr query would be tyepDef=dismax&qf=genre,topic&q=genre:novel AND topic:about love. However, this returns no results. If I use edismax, however, all documents which topic begins with "about" are returned. These are two different extremes, nothing or all. How can I configure my query so exactly documents that satisfy both genre:novel and topic:about love will be returned?


Solution

  • I suppose as the genre is fixed, you should not be querying on the genre field.
    You should rather be filtering on the genre field.
    e.g. fq=genre:novel, this will be much more faster instead of the normal search.

    The topic is a content field and can then be search as a normal query q=topic:about or as you are already using dismax/edismax you can use q=about&qf=topic