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

Improved search results. #291

Merged
merged 3 commits into from
Jul 11, 2017
Merged

Improved search results. #291

merged 3 commits into from
Jul 11, 2017

Conversation

elcct
Copy link
Contributor

@elcct elcct commented Jul 10, 2017

This fixes problem with non deterministic results whilst testing by setting number of shards to 1 for the test.

It uses alias field for names, which has lowercase keyword analyser mapped to it. This field is used in the term query to boost results of exact matches.

@codecov-io
Copy link

codecov-io commented Jul 10, 2017

Codecov Report

Merging #291 into develop will decrease coverage by 0.02%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #291      +/-   ##
==========================================
- Coverage    92.92%   92.9%   -0.03%     
==========================================
  Files           63      63              
  Lines         2417    2423       +6     
  Branches       212     213       +1     
==========================================
+ Hits          2246    2251       +5     
+ Misses         145     144       -1     
- Partials        26      28       +2
Impacted Files Coverage Δ
datahub/search/elasticsearch.py 96.92% <87.5%> (-1.39%) ⬇️
datahub/company/admin.py 89.47% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c754b51...f02f4d9. Read the comment docs.

@elcct elcct requested review from reupen and canni July 10, 2017 15:52
@@ -307,7 +310,8 @@ class InvestmentProject(DocType, MapDBModelToDict):
'id': String(index='not_analyzed'),
'name': String()
}) # InvestmentType
name = String()
name = String(copy_to='name_keyword')
name_keyword = String(analyzer='lowercase_keyword_analyzer')
description = String()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the duplicate description attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch :) Done.

@elcct elcct merged commit 7bf0584 into develop Jul 11, 2017
@elcct elcct deleted the feature/search-custom-analyzer branch July 11, 2017 09:54
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

Successfully merging this pull request may close these issues.

3 participants