-
Notifications
You must be signed in to change notification settings - Fork 1
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
Origin/user friendly searching #14
base: main
Are you sure you want to change the base?
Changes from 5 commits
ff1029a
a0612a7
ce4e905
ed1c9b7
89faf3d
007de22
aeabbdb
5e1d8e1
7067177
2173520
3fa6399
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Search</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
background-color: #f9f9f9; | ||
} | ||
.container { | ||
width: 80%; | ||
margin: 0 auto; | ||
padding: 20px; | ||
} | ||
h1 { | ||
text-align: center; | ||
color: #333; | ||
} | ||
.form-group { | ||
margin-bottom: 20px; | ||
} | ||
label { | ||
font-size: 16px; | ||
margin-bottom: 8px; | ||
display: block; | ||
} | ||
input[type="text"], select, button { | ||
padding: 10px; | ||
font-size: 16px; | ||
width: 100%; | ||
max-width: 400px; | ||
margin-top: 5px; | ||
} | ||
button { | ||
background-color: #4CAF50; | ||
color: white; | ||
border: none; | ||
cursor: pointer; | ||
font-size: 16px; | ||
} | ||
button:hover { | ||
background-color: #45a049; | ||
} | ||
.results-list { | ||
margin-top: 30px; | ||
} | ||
.result-item { | ||
background-color: #fff; | ||
border: 1px solid #ddd; | ||
padding: 15px; | ||
margin-bottom: 10px; | ||
border-radius: 5px; | ||
} | ||
.error-message { | ||
color: red; | ||
font-size: 16px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Search CCV/LCV Definitions</h1> | ||
|
||
<form method="POST"> | ||
{% csrf_token %} | ||
<div class="form-group"> | ||
<label for="search_term">Search Term:</label> | ||
<input type="text" name="search_term" id="search_term" placeholder="Enter search term" required> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="search_type">Search By:</label> | ||
<select name="search_type" id="search_type"> | ||
<option value="alias">Alias</option> | ||
<option value="definition">Definition</option> | ||
<option value="context">Context</option> | ||
<option value="general">General</option> | ||
</select> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<button type="submit">Search</button> | ||
</div> | ||
</form> | ||
|
||
<!-- Display search results --> | ||
{% if results %} | ||
<div class="results-list"> | ||
<h3>Search Results</h3> | ||
{% for result in results %} | ||
<div class="result-item"> | ||
<strong>LCVID:</strong> {{ result.LCVID }}<br> | ||
<strong>Alias:</strong> {{ result.Alias }}<br> | ||
<strong>Definition:</strong> {{ result.Definition }}<br> | ||
<strong>Context:</strong> {{ result.Context|default:"No context" }}<br> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
|
||
{% if error %} | ||
<p class="error-message">{{ error }}</p> | ||
{% endif %} | ||
</div> | ||
</body> | ||
</html> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ services: | |
- '3310:3306' | ||
environment: | ||
MYSQL_DATABASE: "${DB_NAME}" | ||
MYSQL_USER: "${DB_USER}" | ||
MYSQL_USER: "${DB_USER}" | ||
MYSQL_PASSWORD: "${DB_PASSWORD}" | ||
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}" | ||
# MYSQL_HOST: '' | ||
|
@@ -16,6 +16,7 @@ services: | |
|
||
neo4j: | ||
image: neo4j:5.15.0 | ||
restart: always | ||
ports: | ||
- '7687:7687' | ||
- '7474:7474' | ||
|
@@ -47,25 +48,17 @@ services: | |
# BAD_HOST: "${BAD_HOST}" | ||
# OVERIDE_HOST: "${OVERIDE_HOST}" | ||
# STRATEGY: "${STRATEGY}" | ||
SENTENCE_TRANSFORMERS_HOME: "${SENTENCE_TRANSFORMERS_HOME}" | ||
HF_HOME: "${HF_HOME}" | ||
TRANSFORMERS_CACHE: "${TRANSFORMERS_CACHE}" | ||
HF_DATASETS_CACHE: "${HF_DATASETS_CACHE}" | ||
#NEO4J_URL: "bolt://neo4j:password@neo4j:7687" | ||
volumes: | ||
- ./app:/opt/app/openlxp-xss | ||
- huggingface_data:/opt/app/huggingface | ||
depends_on: | ||
- neo4j | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The neo4j dependency should not be removed here, as the app container does definitely depend on it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uhh, I did not touch the .yml file for the manual search function. |
||
- db-xss | ||
networks: | ||
- openlxp | ||
volumes: | ||
es_data: | ||
driver: local | ||
data01: | ||
driver: local | ||
huggingface_data: | ||
driver: local | ||
networks: | ||
openlxp: | ||
driver: bridge | ||
# Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole block shoul be removed -- get the connection string from settings.