wip - remote content from text search until can do partial search
This commit is contained in:
parent
1e35f069b0
commit
d460b0947a
2 changed files with 6 additions and 5 deletions
|
|
@ -63,13 +63,13 @@ DEFINE FUNCTION IF NOT EXISTS fn::text_search($query_text: string, $match_count:
|
|||
let $note_results = array::union($note_title_search, $note_content_search );
|
||||
let $final_results = array::union($source_results, $note_results );
|
||||
|
||||
RETURN (select id, parent_id, title, math::max(relevance) as relevance,
|
||||
array::flatten(content) as matches
|
||||
RETURN (select id, parent_id, title, math::max(relevance) as relevance
|
||||
from $final_results where id is not None
|
||||
group by id, parent_id, title ORDER BY relevance DESC LIMIT $match_count);
|
||||
|
||||
};
|
||||
|
||||
|
||||
REMOVE FUNCTION IF EXISTS fn::vector_search;
|
||||
|
||||
DEFINE FUNCTION IF NOT EXISTS fn::vector_search($query: array<float>, $match_count: int, $sources: bool, $show_notes: bool, $min_similarity: float) {
|
||||
|
|
|
|||
|
|
@ -42,9 +42,10 @@ def results_card(item):
|
|||
st.markdown(
|
||||
f"[{score:.2f}] **[{item['title']}](/?object_id={item['parent_id']})**"
|
||||
)
|
||||
with st.expander("Matches"):
|
||||
for match in item["matches"]:
|
||||
st.markdown(match)
|
||||
if "matches" in item:
|
||||
with st.expander("Matches"):
|
||||
for match in item["matches"]:
|
||||
st.markdown(match)
|
||||
|
||||
|
||||
with ask_tab:
|
||||
|
|
|
|||
Loading…
Reference in a new issue