maaikeb / elasticsearch-benchmarking Goto Github PK
View Code? Open in Web Editor NEWA tool to measure ElasticSearch search performance over time, created for the OpenBudget project
Home Page: https://next.obudget.org/
A tool to measure ElasticSearch search performance over time, created for the OpenBudget project
Home Page: https://next.obudget.org/
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)
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.
Description
Right now the ElasticsearchQuery class doesn't do much, and it should be expanded to be something similar to the Query class in the apies repo:
https://github.com/OpenBudget/apies/blob/master/apies/query.py
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.