MrDys / blacklight

Blacklight Plugin
http://projectblacklight.org/
Other
1 stars 1 forks source link

Discrepancy between search behavior in BL Plugin and BL Advanced Search Plugin #468

Closed MrDys closed 12 years ago

MrDys commented 12 years ago

CODEBASE-283: If I do a title search using the BL plugin, and then do the same search using the BL advanced search plugin, I get different results (at least, for my solr configs). I would expect them to be the same.

For example, if I do a title search in the BL plugin for "time", the first few items all have the title "Time."

If I do a title search in the BL advanced search plugin for "time", the first item is "The Pennsylvania almanack [electronic resource], for the year 1790, ... By Mark Time."

The underlying solr queries that get generated for these two searches are:

sort=score+desc,+year_multisort_i+desc&q={!qf=$qf_title+pf=$pf_title}time&qt=search sort=score+desc,+year_multisort_i+desc&q=query:"{!dismax+mm=1+qf=$qf_title+pf=$pf_title}%2Btime"&qt=search&defType=lucene

For your reference, here are the requestHandler entries for qf_title and pf_title:

title_text^20.0 subtitle_text^15 title_added_entry_text series_title_text notes_text uniform_title_text alternate_form_title_text title_facet^100 title_unstem_text^20.0 author_unstem_text^20 subject_unstem_text^20 text^15.0
MrDys commented 12 years ago

Original reporter: darthmolly

MrDys commented 12 years ago

jrochkind: Beleive this was taken care of by Molly in her local configuration; also the newest adv search plugin uses different code which should make this sort of issue unlikely.

MrDys commented 12 years ago

ndushay: the local params work in the advanced search plugin was done by jessie to my exacting specifications, which are here: h"p://www.stanford.edu/people/~ndushay/code4lib2010/advSearchSolrQueries.pdf

for advanced search, we explicitly use a request handler with mm set to 1, so the default operator is effectively "OR", and then we use the "+" in the solr query to indicate required for "AND"

note further that the expectation of users tends to be for an explicit "AND" in their queries, at most sites. So the query magic in jessie's code (and in my spec) pertains to accommodating the expectation of "AND".

MrDys commented 12 years ago

darthmolly: Per Erik's request, here is the output of debugQuery=true for the two searches in question.

BL plugin:

+DisjunctionMaxQuery((uniform_title_text:time | title_added_entry_text:time | title_text:time^20.0 | notes_text:time | subtitle_text:time^15.0 | series_title_text:time | alternate_form_title_text:time)~0.01) DisjunctionMaxQuery((author_unstem_text:time^20.0 | text:time^15.0 | title_facet:time^100.0 | title_unstem_text:time^20.0 | subject_unstem_text:time^20.0)~0.01)

BL advanced serch:

+(+DisjunctionMaxQuery((uniform_title_text:time | title_added_entry_text:time | title_text:time^20.0 | notes_text:time | subtitle_text:time^15.0 | series_title_text:time | alternate_form_title_text:time)~0.01)) DisjunctionMaxQuery((author_unstem_text:time^20.0 | text:time^15.0 | title_facet:+time^100.0 | title_unstem_text:time^20.0 | subject_unstem_text:time^20.0)~0.01)