Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritizing columns #38

Closed
acasar opened this issue Sep 2, 2016 · 9 comments
Closed

Prioritizing columns #38

acasar opened this issue Sep 2, 2016 · 9 comments

Comments

@acasar
Copy link
Contributor

acasar commented Sep 2, 2016

I'm having some issues with the ranking. Is there any way to tell the driver to prioritize results that contain a match in the title rather than in the body? Right now it seems both columns have equal weight and the items I'm looking for almost never show at the top.

Thanks!

@nticaric
Copy link
Contributor

nticaric commented Sep 2, 2016

In order to achieve this you could do something called query expansion. Each query that comes in,
would be extended with a keyword that matches your result ie. We use this on the demo page.

class QueryExpansion
{
    public static $query = [
        'house'          => 'house hugh',
        'friends'        => 'friends aniston',
        'game of'        => 'game of thrones',
        'game'           => 'game of thrones',
        'breaking'       => 'breaking bad',
        'walker'         => 'walker texas',
        'nanny'          => 'nanny fran',
        'how'            => 'how i',
        'the big bang'   => 'the big bang theory',
        'the big'        => 'the big bang theory',
        'malcolm'        => 'malcolm in the middle',
        'two and a half' => 'two and a half men',
        'two and a'      => 'two and a half men',
        'two and'        => 'two and a half men',
    ];
    public static function expand($query)
    {
        $query = trim($query);
        if (isset(self::$query[$query])) {
            return self::$query[$query];
        }
        return $query;
    }
}

@nticaric
Copy link
Contributor

nticaric commented Sep 2, 2016

In the next versions of the package we plan to add field weighting

@acasar
Copy link
Contributor Author

acasar commented Sep 2, 2016

Thanks for a quick reply! Glad to hear that field weighting is planned. 👍 Till then I'll just implement some workaround. Thanks.

@acasar acasar closed this as completed Sep 2, 2016
@hipsterjazzbo
Copy link

@nticaric Sorry to resurrect an old thread, but are there still plans to add field weighting?

@nticaric
Copy link
Contributor

Yes, there are plans, however this is a side project so we're only working on it in our spare time.

@SaphiLC
Copy link

SaphiLC commented Sep 24, 2018

still busy i guess?

@janzikmund
Copy link

any news about field weighting? I would love to see this feature also

@pablodegrande
Copy link

I am evaluating this search engine for a open science project... is there any estimated time for field weighting?

@Tofandel
Copy link

This is an old issue but I don't think it should be closed, has this ever been implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants