Skip to content

Commit

Permalink
Merge pull request #32 from thepsalmist/query-fixes
Browse files Browse the repository at this point in the history
change query fto field name from field.keyword and typo fix
  • Loading branch information
rahulbot authored Dec 7, 2023
2 parents 05f184c + e46dd3a commit a018774
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,23 +187,23 @@ def cs_terms_query(q: str, field: str = "article_title", aggr: str = "top"):
aggr_map = {
"top": {
"terms": {
"field": f"{field}.keyword",
"field": field,
"size": resct,
"min_doc_count": 10,
"shard_min_doc_count": 5
}
},
"significant": {
"significant_terms": {
"field": f"{field}.keyword",
"field": field,
"size": resct,
"min_doc_count": 10,
"shard_min_doc_count": 5
}
},
"rare": {
"rare_terms": {
"field": f"{field}.keyword",
"field": field,
"exclude": "[0-9].*"
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def load_data(cname, qstr, ep="search/overview"):
tbs[0].altair_chart(c, use_container_width=True)
tbs[1].write(ov[v])

for fld in ["article_title", "text_context"]:
for fld in ["article_title", "text_content"]:
cols = st.columns(3)
for i, aggr in enumerate(["top", "significant", "rare"]):
with cols[i]:
Expand Down

0 comments on commit a018774

Please sign in to comment.