Code Monkey home page Code Monkey logo

elasticsearch-benchmarking's People

Contributors

maaikeb avatar

Watchers

 avatar  avatar  avatar

elasticsearch-benchmarking's Issues

Add abstraction for more generic use

Add abstraction for more generic use, so that it can easily be used for search engines other than ElasticSearch.

The code could be according to the below pseudo-code:

class Result(dict):

    def position(self):
        raise NotImplementedError()


class ElasticSearchResult(Result):
    pass


class Query(object):
    pass


class ElasticSearchQuery(Query):

    def __init__(self, term, filters={})
        pass


class BaseResultOracle(object):
    def query(self, query: Query) -> Result[]:
        raise NotImplementedError()


class ElasticSearchOracle(BaseResultOracle):

    def query(self, query: ElasticSearchQuery):
        # returns ElasticSearchResult[]

class BaseScorer(object):
    def calculate_score(self, matcher_results) -> float:
        raise NotImplementedError()

class FirstPageScorer(BaseScorer):
    pass
    
    
b = Benchmark(
    oracle=ElasticSearchOracle(hostname, port),
    scorer=FirstPageScorer(page_size=10, factor=0.87),
)

test_b = Benchmark(
    oracle=FixedResultsOracle(test_results),
    scorer=ConstScorer(5),
)

test_suite = [
    (ElasticSearchQuery('JK Rowling'), lambda r: r['author'] == 'JK Rowling'),
    (ElasticSearchQuery('Harry Potter 1'), lambda r: r['isbn'] == '12331234657465'),
]

score = b.execute(test_suite)

Add tests

Description

Add more tests, both queries that return expected results correctly, as well as cases of queries that don't return all the expected results.

Examples of queries on the entities index that dont return all the expected results:

שיקום
returns results with הקמה instead of שיקום

קוד פתוח
returns results with only פתוח 

This happens probably because of the analyzer_hebrew

Can ask @noamoss for more cases.

Enhance scoring function(s)

Description

Currently there is a default scoring function - the FirstPageScorer.
It returns the ratio of the results that meet the requirement to the total amount of results.
This is not very sophisticated, and can probably use improvement.
Also, add ideas for other scoring methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.