[Koha-bugs] [Bug 9588] weighted search query with index

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 5 11:24:05 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9588

M. de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15271|0                           |1
        is obsolete|                            |

--- Comment #9 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 17205
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17205&action=edit
Bug 9588: weighted search query with index

When QueryWeightFields is enabled, the searching query is created with several
options.
In C4::Search::_build_weighted_query, when no index is defined, the query is
build with fuzzy and stemming options. When an index is defined, theses options
are missing, only unconditional right truncation is used.
The consequence is that when QueryStemming is disabled, a search with index can
give more results (due to right truncation) that a search without.

This patch adds stemming and fuzzy on search with index, conditioned with
QueryFuzzy and QuerryStemming sysprefs.
Also changes world list search (wrld) weight to r6 in order to set fuzzy search
to r8 and stemming search to r9 (like search without index).

Test plan :
- Go to searching preferences (admin/preferences.pl?tab=searching)
- Set QueryAutoTruncate to "only if * is added"
- Set QueryFuzzy and QuerryStemming to "Don't try"
- Set QueryWeightFields to "Enable"
- Go to advanced search page
- Select an indexe (ie Title) and perform a search on a short word
=> Look at zebrarv log and see that query does not contain right truncation :
@attr 5=1
- Set QueryFuzzy to "Try"
- Perform same search
=> Look at zebrarv log and see that query contains fuzzy : @attr 5=103
- Set QueryFuzzy to "Don't try" and QuerryStemming to "Try"
- Perform same search
=> Look at zebrarv log and see that query contains rigth truncation on stemmed
word : @attr 5=1

Signed-off-by: koha.aixmarseille <koha.aixmarseille at gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
This patch makes Fuzzy and Stemming influence search results on weighted
queries when using an index. Side-effect is however that the results for a
search like index=term* (add truncation manually too) could be LOWER than the
the number of hits for index=term. Further comments on Bugzilla.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list