Page MenuHomeIn-Portal Phabricator

INP-1409 - Don't calculate search relevance twice, when searching for one word only
ClosedPublic

Authored by glebs on Feb 20 2015, 6:39 AM.

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

glebs updated this revision to Diff 105.Feb 20 2015, 6:39 AM
glebs retitled this revision from to INP-1409 Double weight in search relevance calculation.
glebs updated this object.
glebs edited the test plan for this revision. (Show Details)
glebs added 1 JIRA issue(s): INP-1409.
alex requested changes to this revision.Feb 20 2015, 7:40 AM
alex edited edge metadata.
alex added a subscriber: dmitry.

Need to think about what are pros/cons of each approach described as inline comment below.

core/kernel/db/cat_event_handler.php
1322–1325 ↗(On Diff #105)
NOTE: Same applies to changes in other file.

The $positive_words are basically all keywords, that don't have - (minus sign) in front of them. So the only case, when we won't have them is with search keyword like this: -"don't include me", which will find all records that don't include that text.

What I'm unsure about is, what weight to use ($weight or $weight_sum), when we have 1 positive keyword.

// cc: @dmitry

This revision now requires changes to proceed.Feb 20 2015, 7:40 AM
alex added inline comments.Feb 20 2015, 10:10 AM
core/kernel/db/cat_event_handler.php
1322–1325 ↗(On Diff #105)

@dmitry confirmed, that we:

  1. should remove if ( count($positive_words) > 1 ) { from his current location
  2. add if ( count($positive_words) > 1 ) { around 1233 line (where $weight_sum is used)
glebs updated this revision to Diff 106.Feb 20 2015, 10:30 AM
glebs edited edge metadata.

Change weight, applied to search by one word

alex accepted this revision.Feb 20 2015, 10:38 AM
alex edited edge metadata.
This revision is now accepted and ready to land.Feb 20 2015, 10:38 AM
This revision was automatically updated to reflect the committed changes.
alex edited the test plan for this revision. (Show Details)Mar 10 2016, 6:45 AM
alex edited edge metadata.
alex added a project: Restricted Project.
alex retitled this revision from INP-1409 Double weight in search relevance calculation to INP-1409 - Don't calculate search relevance twice, when searching for one word only.Mar 27 2016, 6:10 AM